Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/browser/resources/print_preview/margins_ui.js

Issue 8394020: Print Preview: Improving accessibility of margins UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/print_preview/margins.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'strict'; 6 'strict';
7 7
8 function MarginsUI() { 8 function MarginsUI() {
9 var marginsUI = document.createElement('div'); 9 var marginsUI = document.createElement('div');
10 marginsUI.__proto__ = MarginsUI.prototype; 10 marginsUI.__proto__ = MarginsUI.prototype;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 draw: function() { 100 draw: function() {
101 this.applyClippingMask_(); 101 this.applyClippingMask_();
102 this.pairsAsList.forEach(function(pair) { pair.draw(); }); 102 this.pairsAsList.forEach(function(pair) { pair.draw(); });
103 }, 103 },
104 104
105 /** 105 /**
106 * Shows the margins UI. 106 * Shows the margins UI.
107 */ 107 */
108 show: function() { 108 show: function() {
109 this.hidden = false; 109 this.hidden = false;
110 this.classList.remove('invisible');
110 }, 111 },
111 112
112 /** 113 /**
113 * Hides the margins UI. 114 * Hides the margins UI and removes from the rendering flow if requested.
115 * @param {boolean} removeFromFlow True if |this| should also be removed
116 * from the rendering flow (in order to not interfere with the tab
117 * order).
114 */ 118 */
115 hide: function() { 119 hide: function(removeFromFlow) {
116 this.hidden = true; 120 removeFromFlow ? this.hidden = true : this.classList.add('invisible');
117 }, 121 },
118 122
119 /** 123 /**
120 * Applies a clipping mask on |this| so that it does not paint on top of the 124 * Applies a clipping mask on |this| so that it does not paint on top of the
121 * scrollbars (if any). 125 * scrollbars (if any).
122 */ 126 */
123 applyClippingMask_: function() { 127 applyClippingMask_: function() {
124 var bottom = previewArea.height; 128 var bottom = previewArea.height;
125 var right = previewArea.width; 129 var right = previewArea.width;
126 this.style.clip = "rect(0, " + right + "px, " + bottom + "px, 0)"; 130 this.style.clip = "rect(0, " + right + "px, " + bottom + "px, 0)";
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 this.lastClickedMarginsUIPair.getDragDisplacementFrom(point); 196 this.lastClickedMarginsUIPair.getDragDisplacementFrom(point);
193 dragEvent.destinationPoint = point; 197 dragEvent.destinationPoint = point;
194 this.dispatchEvent(dragEvent); 198 this.dispatchEvent(dragEvent);
195 }, 199 },
196 }; 200 };
197 201
198 return { 202 return {
199 MarginsUI: MarginsUI 203 MarginsUI: MarginsUI
200 }; 204 };
201 }); 205 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/margins.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698