diff --git a/modules/sandbox/images/fade-down.png b/modules/es/images/fade-down.png similarity index 100% rename from modules/sandbox/images/fade-down.png rename to modules/es/images/fade-down.png diff --git a/modules/sandbox/images/fade-up.png b/modules/es/images/fade-up.png similarity index 100% rename from modules/sandbox/images/fade-up.png rename to modules/es/images/fade-up.png diff --git a/modules/es/models/es.SurfaceModel.js b/modules/es/models/es.SurfaceModel.js index 4268489bf2..f9cc472824 100644 --- a/modules/es/models/es.SurfaceModel.js +++ b/modules/es/models/es.SurfaceModel.js @@ -13,7 +13,6 @@ es.SurfaceModel = function( doc ) { // Properties this.doc = doc; this.selection = new es.Range(); - this.previousSelection = null; this.states = [[]]; this.initializeState( this.states.length - 1 ); @@ -69,10 +68,9 @@ es.SurfaceModel.prototype.select = function( selection, combine ) { this.pushState(); } // Filter out calls to select if they do not change the selection values - this.selection = selection; - var selectionChanged = !this.previousSelection || ( - this.previousSelection.from !== this.selection.from || - this.previousSelection.to !== this.selection.to + var selectionChanged = !this.selection || ( + this.selection.from !== selection.from || + this.selection.to !== selection.to ); if ( !combine || selectionChanged ) { var lastAction = this.states[this.states.length - 1]; @@ -82,11 +80,11 @@ es.SurfaceModel.prototype.select = function( selection, combine ) { ); } this.currentState.push( selection ); + this.selection = selection; if ( selectionChanged ) { this.emit( 'select', this.selection.clone() ); } } - this.previousSelection = this.selection.clone(); }; /** diff --git a/modules/sandbox/sandbox.css b/modules/sandbox/sandbox.css index 13d3a4d53c..5c3ee85f34 100644 --- a/modules/sandbox/sandbox.css +++ b/modules/sandbox/sandbox.css @@ -5,7 +5,7 @@ -moz-border-radius: 0.25em; -o-border-radius: 0.25em; border-radius: 0.25em; - background-image: url(images/fade-up.png); + background-image: url(../es/images/fade-up.png); background-position: bottom left; background-repeat: repeat-x; } @@ -78,7 +78,7 @@ list-style-type: square; margin: .3em 0 0 1.5em; padding: 0; - list-style-image: url(images/bullet-icon.png); + list-style-image: url(../es/images/bullet-icon.png); } .es-render ol { line-height: 1.5em;