Better drag interface, start of reorder dragging

This commit is contained in:
Max Lynch
2013-10-11 17:44:07 -05:00
parent 1839797a24
commit 7496347f6b
7 changed files with 383 additions and 304 deletions

28
js/utils/dom.js Normal file
View File

@ -0,0 +1,28 @@
(function(ionic) {
ionic.DomUtil = {
/**
* {returns} the closest parent matching the className
*/
getParentWithClass: function(e, className) {
while(e.parentNode) {
if(e.parentNode.classList && e.parentNode.classList.contains(className)) {
return e.parentNode;
}
e = e.parentNode;
}
return null;
},
/**
* {returns} the closest parent or self matching the className
*/
getParentOrSelfWithClass: function(e, className) {
while(e) {
if(e.classList && e.classList.contains(className)) {
return e;
}
e = e.parentNode;
}
return null;
}
}
})(window.ionic);