| 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 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 * Show the position at the specific position. | 1141 * Show the position at the specific position. |
| 1142 * | 1142 * |
| 1143 * @param {string} pos The 'pos' attribute value. | 1143 * @param {string} pos The 'pos' attribute value. |
| 1144 * @param {string} text The prompt text. | 1144 * @param {string} text The prompt text. |
| 1145 * @param {number} timeout Timeout in ms. | 1145 * @param {number} timeout Timeout in ms. |
| 1146 * @param {...Object} var_formatArgs varArgs for the formatting function. | 1146 * @param {...Object} var_formatArgs varArgs for the formatting function. |
| 1147 */ | 1147 */ |
| 1148 ImageEditor.Prompt.prototype.showAt = function( | 1148 ImageEditor.Prompt.prototype.showAt = function( |
| 1149 pos, text, timeout, var_formatArgs) { | 1149 pos, text, timeout, var_formatArgs) { |
| 1150 var args = [text].concat(Array.prototype.slice.call(arguments, 3)); | 1150 var args = [text].concat(Array.prototype.slice.call(arguments, 3)); |
| 1151 var message = this.displayStringFunction_.apply( | 1151 var message = this.displayStringFunction_.apply(null, args); |
| 1152 null, [text].concat(args)); | |
| 1153 this.showStringAt(pos, message, timeout); | 1152 this.showStringAt(pos, message, timeout); |
| 1154 }; | 1153 }; |
| 1155 | 1154 |
| 1156 /** | 1155 /** |
| 1157 * Show the string in the prompt | 1156 * Show the string in the prompt |
| 1158 * | 1157 * |
| 1159 * @param {string} pos The 'pos' attribute value. | 1158 * @param {string} pos The 'pos' attribute value. |
| 1160 * @param {string} text The prompt text. | 1159 * @param {string} text The prompt text. |
| 1161 * @param {number} timeout Timeout in ms. | 1160 * @param {number} timeout Timeout in ms. |
| 1162 */ | 1161 */ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 | 1195 |
| 1197 /** | 1196 /** |
| 1198 * Hide the prompt. | 1197 * Hide the prompt. |
| 1199 */ | 1198 */ |
| 1200 ImageEditor.Prompt.prototype.hide = function() { | 1199 ImageEditor.Prompt.prototype.hide = function() { |
| 1201 if (!this.prompt_) return; | 1200 if (!this.prompt_) return; |
| 1202 this.prompt_.setAttribute('state', 'fadeout'); | 1201 this.prompt_.setAttribute('state', 'fadeout'); |
| 1203 // Allow some time for the animation to play out. | 1202 // Allow some time for the animation to play out. |
| 1204 this.setTimer(this.reset.bind(this), 500); | 1203 this.setTimer(this.reset.bind(this), 500); |
| 1205 }; | 1204 }; |
| OLD | NEW |