OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 Legacy supervised user creation flow screen. | 6 * @fileoverview Legacy supervised user creation flow screen. |
7 */ | 7 */ |
8 | 8 |
9 login.createScreen('SupervisedUserCreationScreen', | 9 login.createScreen('SupervisedUserCreationScreen', |
10 'supervised-user-creation', function() { | 10 'supervised-user-creation', function() { |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 var scrollTop = scroller.scrollTop; | 396 var scrollTop = scroller.scrollTop; |
397 var top = pod.offsetTop - scroller.offsetTop; | 397 var top = pod.offsetTop - scroller.offsetTop; |
398 var clientHeight = scroller.clientHeight; | 398 var clientHeight = scroller.clientHeight; |
399 | 399 |
400 var self = scroller; | 400 var self = scroller; |
401 | 401 |
402 // Function to adjust the tops of viewport and row. | 402 // Function to adjust the tops of viewport and row. |
403 function scrollToAdjustTop() { | 403 function scrollToAdjustTop() { |
404 self.scrollTop = top; | 404 self.scrollTop = top; |
405 return true; | 405 return true; |
406 }; | 406 } |
407 // Function to adjust the bottoms of viewport and row. | 407 // Function to adjust the bottoms of viewport and row. |
408 function scrollToAdjustBottom() { | 408 function scrollToAdjustBottom() { |
409 var cs = getComputedStyle(self); | 409 var cs = getComputedStyle(self); |
410 var paddingY = parseInt(cs.paddingTop, 10) + | 410 var paddingY = parseInt(cs.paddingTop, 10) + |
411 parseInt(cs.paddingBottom, 10); | 411 parseInt(cs.paddingBottom, 10); |
412 | 412 |
413 if (top + itemHeight > scrollTop + clientHeight - paddingY) { | 413 if (top + itemHeight > scrollTop + clientHeight - paddingY) { |
414 self.scrollTop = top + itemHeight - clientHeight + paddingY; | 414 self.scrollTop = top + itemHeight - clientHeight + paddingY; |
415 return true; | 415 return true; |
416 } | 416 } |
417 return false; | 417 return false; |
418 }; | 418 } |
419 | 419 |
420 // Check if the entire of given indexed row can be shown in the viewport. | 420 // Check if the entire of given indexed row can be shown in the viewport. |
421 if (itemHeight <= clientHeight) { | 421 if (itemHeight <= clientHeight) { |
422 if (top < scrollTop) | 422 if (top < scrollTop) |
423 return scrollToAdjustTop(); | 423 return scrollToAdjustTop(); |
424 if (scrollTop + clientHeight < top + itemHeight) | 424 if (scrollTop + clientHeight < top + itemHeight) |
425 return scrollToAdjustBottom(); | 425 return scrollToAdjustBottom(); |
426 } else { | 426 } else { |
427 if (scrollTop < top) | 427 if (scrollTop < top) |
428 return scrollToAdjustTop(); | 428 return scrollToAdjustTop(); |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 | 1582 |
1583 if (selectedIndex >= 0) | 1583 if (selectedIndex >= 0) |
1584 this.importList_.selectPod(this.importList_.pods[selectedIndex]); | 1584 this.importList_.selectPod(this.importList_.pods[selectedIndex]); |
1585 | 1585 |
1586 if (this.currentPage_ == 'username') | 1586 if (this.currentPage_ == 'username') |
1587 this.getScreenElement('import-link').hidden = (userList.length == 0); | 1587 this.getScreenElement('import-link').hidden = (userList.length == 0); |
1588 }, | 1588 }, |
1589 }; | 1589 }; |
1590 }); | 1590 }); |
1591 | 1591 |
OLD | NEW |