Created
June 16, 2014 14:59
-
-
Save emadb/38cf4c94ac858382300c to your computer and use it in GitHub Desktop.
Javascript refactoring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mouseup(evt) { | |
if (_isDD) { | |
return; | |
} | |
if (evt.shiftKey == true) { | |
var indexOf1 = this.cont.list.indexOf(_lastItemSelected); | |
var indexOf2 = this.cont.list.indexOf(this); | |
for (var i = indexOf2; i > indexOf1; i--) { | |
var item = this.cont.list[i]; | |
if (!item.elem.hasClassName('mkdd-selected')) { | |
this.selectItem(item); | |
} else { | |
break; | |
} | |
} | |
for (var j = indexOf2; j < indexOf1 ; j++) { | |
var item = this.cont.list[j]; | |
if (!item.elem.hasClassName('mkdd-selected')) { | |
this.selectItem(item); | |
} else { | |
break; | |
} | |
} | |
} else { | |
if (this.elem.hasClassName('mkdd-selected')) { | |
this.elem.removeClassName('mkdd-selected'); | |
} | |
else { | |
this.selectItem(this); | |
} | |
} | |
_lastItemSelected = this; | |
this.isMouseup = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Questa è la mia: