| OLD | NEW |
| 1 | 1 |
| 2 // Helpers | 2 // Helpers |
| 3 | 3 |
| 4 function $(id) { | 4 function $(id) { |
| 5 return document.getElementById(id); | 5 return document.getElementById(id); |
| 6 } | 6 } |
| 7 | 7 |
| 8 // TODO(arv): Remove these when classList is available in HTML5. | 8 // TODO(arv): Remove these when classList is available in HTML5. |
| 9 // https://bugs.webkit.org/show_bug.cgi?id=20709 | 9 // https://bugs.webkit.org/show_bug.cgi?id=20709 |
| 10 function hasClass(el, name) { | 10 function hasClass(el, name) { |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 | 1048 |
| 1049 window.addEventListener('blur', hideAllMenus); | 1049 window.addEventListener('blur', hideAllMenus); |
| 1050 window.addEventListener('keydown', function(e) { | 1050 window.addEventListener('keydown', function(e) { |
| 1051 if (e.keyIdentifier == 'Alt' || e.keyIdentifier == 'Meta') { | 1051 if (e.keyIdentifier == 'Alt' || e.keyIdentifier == 'Meta') { |
| 1052 hideAllMenus(); | 1052 hideAllMenus(); |
| 1053 } | 1053 } |
| 1054 }, true); | 1054 }, true); |
| 1055 | 1055 |
| 1056 // Tooltip for elements that have text that overflows. | 1056 // Tooltip for elements that have text that overflows. |
| 1057 document.addEventListener('mouseover', function(e) { | 1057 document.addEventListener('mouseover', function(e) { |
| 1058 // We don't want to do this while we are dragging because it makes things very |
| 1059 // janky |
| 1060 if (dnd.dragItem) { |
| 1061 return; |
| 1062 } |
| 1063 |
| 1058 var el = findAncestor(e.target, function(el) { | 1064 var el = findAncestor(e.target, function(el) { |
| 1059 return el.xtitle; | 1065 return el.xtitle; |
| 1060 }); | 1066 }); |
| 1061 if (el && el.xtitle != el.title) { | 1067 if (el && el.xtitle != el.title) { |
| 1062 if (el.scrollWidth > el.clientWidth) { | 1068 if (el.scrollWidth > el.clientWidth) { |
| 1063 el.title = el.xtitle; | 1069 el.title = el.xtitle; |
| 1064 } else { | 1070 } else { |
| 1065 el.title = ''; | 1071 el.title = ''; |
| 1066 } | 1072 } |
| 1067 } | 1073 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 el.addEventListener('dragover', bind(this.handleDragOver, this)); | 1191 el.addEventListener('dragover', bind(this.handleDragOver, this)); |
| 1186 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); | 1192 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); |
| 1187 el.addEventListener('drop', bind(this.handleDrop, this)); | 1193 el.addEventListener('drop', bind(this.handleDrop, this)); |
| 1188 el.addEventListener('dragend', bind(this.handleDragEnd, this)); | 1194 el.addEventListener('dragend', bind(this.handleDragEnd, this)); |
| 1189 el.addEventListener('drag', bind(this.handleDrag, this)); | 1195 el.addEventListener('drag', bind(this.handleDrag, this)); |
| 1190 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); | 1196 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); |
| 1191 } | 1197 } |
| 1192 }; | 1198 }; |
| 1193 | 1199 |
| 1194 dnd.init(); | 1200 dnd.init(); |
| OLD | NEW |