summaryrefslogtreecommitdiffstats
path: root/js/slide.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/slide.js')
-rw-r--r--js/slide.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/slide.js b/js/slide.js
index befaa6d..ddf294d 100644
--- a/js/slide.js
+++ b/js/slide.js
@@ -24,6 +24,26 @@ Slide.prototype.updateTarget = function() {
this.target = this.x + firstMargin + this.width * this.parent.cellAlign;
};
+Slide.prototype.select = function() {
+ this.changeSelectedClass('add');
+};
+
+Slide.prototype.unselect = function() {
+ this.changeSelectedClass('remove');
+};
+
+Slide.prototype.changeSelectedClass = function( method ) {
+ this.cells.forEach( function( cell ) {
+ cell.element.classList[ method ]('is-selected');
+ });
+};
+
+Slide.prototype.getCellElements = function() {
+ return this.cells.map( function( cell ) {
+ return cell.element;
+ });
+};
+
window.Slide = Slide;
})();