reworked the crop modes some more, now identical states will not get pushed to the state stack...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-09-21 03:24:15 +04:00
parent d30849f387
commit 5ff3b12417
3 changed files with 9 additions and 5 deletions

View File

@ -1572,8 +1572,16 @@ function cropDataTo(gids, keep_ribbons){
var cur = DATA.current
var r = getRibbonIndex()
var new_data = makeCroppedData(gids, keep_ribbons)
// do nothing if there is no change...
// XXX is there a better way to compare states???
if(JSON.stringify(DATA.ribbons) == JSON.stringify(new_data.ribbons)){
return DATA
}
CROP_STACK.push(prev_state)
DATA = makeCroppedData(gids, keep_ribbons)
DATA = new_data
cur = getGIDBefore(cur, keep_ribbons ? r : 0)
cur = cur == null ? gids[0] : cur

View File

@ -59,8 +59,6 @@ var toggleMarkedOnlyView = createCSSClassToggler(
},
function(action){
if(action == 'on'){
// XXX do nothing if there is no change...
// XXX
cropMarkedImages()
} else {
//uncropData()

View File

@ -187,8 +187,6 @@ var toggleSingleRibbonMode = createCSSClassToggler(
},
function(action){
if(action == 'on'){
// XXX do nothing if there is no change...
// XXX
cropDataTo(DATA.ribbons[getRibbonIndex()].slice())
} else {
//uncropData()