| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * ImageEditor is the top level object that holds together and connects | 8 * ImageEditor is the top level object that holds together and connects |
| 9 * everything needed for image editing. | 9 * everything needed for image editing. |
| 10 * | 10 * |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 | 1125 |
| 1126 /** | 1126 /** |
| 1127 * Show the prompt. | 1127 * Show the prompt. |
| 1128 * | 1128 * |
| 1129 * @param {string} text The prompt text. | 1129 * @param {string} text The prompt text. |
| 1130 * @param {number} timeout Timeout in ms. | 1130 * @param {number} timeout Timeout in ms. |
| 1131 * @param {...Object} var_formatArgs varArgs for the formatting function. | 1131 * @param {...Object} var_formatArgs varArgs for the formatting function. |
| 1132 */ | 1132 */ |
| 1133 ImageEditor.Prompt.prototype.show = function(text, timeout, var_formatArgs) { | 1133 ImageEditor.Prompt.prototype.show = function(text, timeout, var_formatArgs) { |
| 1134 var args = [text].concat(Array.prototype.slice.call(arguments, 2)); | 1134 var args = [text].concat(Array.prototype.slice.call(arguments, 2)); |
| 1135 var message = this.displayStringFunction_.apply( | 1135 var message = this.displayStringFunction_.apply(null, args); |
| 1136 null, [text].concat(args)); | |
| 1137 this.showStringAt('center', message, timeout); | 1136 this.showStringAt('center', message, timeout); |
| 1138 }; | 1137 }; |
| 1139 | 1138 |
| 1140 /** | 1139 /** |
| 1141 * Show the position at the specific position. | 1140 * Show the position at the specific position. |
| 1142 * | 1141 * |
| 1143 * @param {string} pos The 'pos' attribute value. | 1142 * @param {string} pos The 'pos' attribute value. |
| 1144 * @param {string} text The prompt text. | 1143 * @param {string} text The prompt text. |
| 1145 * @param {number} timeout Timeout in ms. | 1144 * @param {number} timeout Timeout in ms. |
| 1146 * @param {...Object} var_formatArgs varArgs for the formatting function. | 1145 * @param {...Object} var_formatArgs varArgs for the formatting function. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 | 1194 |
| 1196 /** | 1195 /** |
| 1197 * Hide the prompt. | 1196 * Hide the prompt. |
| 1198 */ | 1197 */ |
| 1199 ImageEditor.Prompt.prototype.hide = function() { | 1198 ImageEditor.Prompt.prototype.hide = function() { |
| 1200 if (!this.prompt_) return; | 1199 if (!this.prompt_) return; |
| 1201 this.prompt_.setAttribute('state', 'fadeout'); | 1200 this.prompt_.setAttribute('state', 'fadeout'); |
| 1202 // Allow some time for the animation to play out. | 1201 // Allow some time for the animation to play out. |
| 1203 this.setTimer(this.reset.bind(this), 500); | 1202 this.setTimer(this.reset.bind(this), 500); |
| 1204 }; | 1203 }; |
| OLD | NEW |