| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Draggable control for setting a page margin. | 9 * Draggable control for setting a page margin. |
| 10 * @param {!print_preview.ticket_items.CustomMargins.Orientation} orientation | 10 * @param {!print_preview.ticket_items.CustomMargins.Orientation} orientation |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 }, | 306 }, |
| 307 | 307 |
| 308 /** @override */ | 308 /** @override */ |
| 309 createDom: function() { | 309 createDom: function() { |
| 310 this.setElementInternal(this.cloneTemplateInternal( | 310 this.setElementInternal(this.cloneTemplateInternal( |
| 311 'margin-control-template')); | 311 'margin-control-template')); |
| 312 this.getElement().classList.add('margin-control-' + this.orientation_); | 312 this.getElement().classList.add('margin-control-' + this.orientation_); |
| 313 this.textbox_ = this.getElement().getElementsByClassName( | 313 this.textbox_ = this.getElement().getElementsByClassName( |
| 314 MarginControl.Classes_.TEXTBOX)[0]; | 314 MarginControl.Classes_.TEXTBOX)[0]; |
| 315 this.textbox_.setAttribute( | 315 this.textbox_.setAttribute( |
| 316 'aria-label', localStrings.getString(this.orientation_)); | 316 'aria-label', loadTimeData.getString(this.orientation_)); |
| 317 this.marginLineEl_ = this.getElement().getElementsByClassName( | 317 this.marginLineEl_ = this.getElement().getElementsByClassName( |
| 318 MarginControl.Classes_.LINE)[0]; | 318 MarginControl.Classes_.LINE)[0]; |
| 319 }, | 319 }, |
| 320 | 320 |
| 321 /** @override */ | 321 /** @override */ |
| 322 enterDocument: function() { | 322 enterDocument: function() { |
| 323 print_preview.Component.prototype.enterDocument.call(this); | 323 print_preview.Component.prototype.enterDocument.call(this); |
| 324 this.tracker.add( | 324 this.tracker.add( |
| 325 this.getElement(), 'mousedown', this.onMouseDown_.bind(this)); | 325 this.getElement(), 'mousedown', this.onMouseDown_.bind(this)); |
| 326 this.tracker.add( | 326 this.tracker.add( |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 this.setIsFocused_(false); | 432 this.setIsFocused_(false); |
| 433 cr.dispatchSimpleEvent(this, MarginControl.EventType.TEXT_CHANGE); | 433 cr.dispatchSimpleEvent(this, MarginControl.EventType.TEXT_CHANGE); |
| 434 } | 434 } |
| 435 }; | 435 }; |
| 436 | 436 |
| 437 // Export | 437 // Export |
| 438 return { | 438 return { |
| 439 MarginControl: MarginControl | 439 MarginControl: MarginControl |
| 440 }; | 440 }; |
| 441 }); | 441 }); |
| OLD | NEW |