| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Nav dot | 6 * @fileoverview Nav dot |
| 7 * This is the class for the navigation controls that appear along the bottom | 7 * This is the class for the navigation controls that appear along the bottom |
| 8 * of the NTP. | 8 * of the NTP. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 if (animate) { | 65 if (animate) { |
| 66 this.classList.add('small'); | 66 this.classList.add('small'); |
| 67 var self = this; | 67 var self = this; |
| 68 window.setTimeout(function() { | 68 window.setTimeout(function() { |
| 69 self.classList.remove('small'); | 69 self.classList.remove('small'); |
| 70 }, 0); | 70 }, 0); |
| 71 } | 71 } |
| 72 }, | 72 }, |
| 73 | 73 |
| 74 /** | 74 /** |
| 75 * Gets the associated TilePage. |
| 76 * @return {TilePage} |
| 77 */ |
| 78 get page() { |
| 79 return this.page_; |
| 80 }, |
| 81 |
| 82 /** |
| 75 * Removes the dot from the page after transitioning to 0 width. | 83 * Removes the dot from the page after transitioning to 0 width. |
| 76 */ | 84 */ |
| 77 animateRemove: function() { | 85 animateRemove: function() { |
| 78 this.classList.add('small'); | 86 this.classList.add('small'); |
| 79 }, | 87 }, |
| 80 | 88 |
| 81 /** | 89 /** |
| 82 * Navigates the card slider to the page for this dot. | 90 * Navigates the card slider to the page for this dot. |
| 83 */ | 91 */ |
| 84 switchToPage: function() { | 92 switchToPage: function() { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 * indicator and prevent default handling so the <input> won't act as a drag | 185 * indicator and prevent default handling so the <input> won't act as a drag |
| 178 * target. | 186 * target. |
| 179 * @param {Event} e The MouseOver event for the drag. | 187 * @param {Event} e The MouseOver event for the drag. |
| 180 * @private | 188 * @private |
| 181 */ | 189 */ |
| 182 doDragOver: function(e) { | 190 doDragOver: function(e) { |
| 183 e.preventDefault(); | 191 e.preventDefault(); |
| 184 | 192 |
| 185 if (!this.dragWrapper_.isCurrentDragTarget) | 193 if (!this.dragWrapper_.isCurrentDragTarget) |
| 186 e.dataTransfer.dropEffect = 'none'; | 194 e.dataTransfer.dropEffect = 'none'; |
| 187 else if (ntp4.getCurrentlyDraggingTile()) | |
| 188 e.dataTransfer.dropEffect = 'move'; | |
| 189 else | 195 else |
| 190 e.dataTransfer.dropEffect = 'copy'; | 196 this.page_.setDropEffect(e.dataTransfer); |
| 191 }, | 197 }, |
| 192 | 198 |
| 193 /** | 199 /** |
| 194 * A dragged element has been dropped on the navigation dot. Tell the page | 200 * A dragged element has been dropped on the navigation dot. Tell the page |
| 195 * to append it. | 201 * to append it. |
| 196 * @param {Event} e The MouseOver event for the drag. | 202 * @param {Event} e The MouseOver event for the drag. |
| 197 * @private | 203 * @private |
| 198 */ | 204 */ |
| 199 doDrop: function(e) { | 205 doDrop: function(e) { |
| 200 e.stopPropagation(); | 206 e.stopPropagation(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 onTransitionEnd_: function(e) { | 240 onTransitionEnd_: function(e) { |
| 235 if (e.propertyName === 'max-width' && this.classList.contains('small')) | 241 if (e.propertyName === 'max-width' && this.classList.contains('small')) |
| 236 this.parentNode.removeChild(this); | 242 this.parentNode.removeChild(this); |
| 237 }, | 243 }, |
| 238 }; | 244 }; |
| 239 | 245 |
| 240 return { | 246 return { |
| 241 NavDot: NavDot, | 247 NavDot: NavDot, |
| 242 }; | 248 }; |
| 243 }); | 249 }); |
| OLD | NEW |