From f3fc47996f3576bd2f7f578c9ffc67b50a928d71 Mon Sep 17 00:00:00 2001 From: Joel Martinez Date: Thu, 4 Feb 2016 12:41:24 -0800 Subject: [PATCH] Allows AbstractDialogPlugin to be sealed, making subclasses compatible with goog.defineClass. RELNOTES: n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=113878307 --- .../editor/plugins/abstractdialogplugin.js | 74 ++++++++----------- 1 file changed, 32 insertions(+), 42 deletions(-) diff --git a/closure/goog/editor/plugins/abstractdialogplugin.js b/closure/goog/editor/plugins/abstractdialogplugin.js index 5b9d4429e4..5fce0b5fad 100644 --- a/closure/goog/editor/plugins/abstractdialogplugin.js +++ b/closure/goog/editor/plugins/abstractdialogplugin.js @@ -46,10 +46,41 @@ goog.require('goog.ui.editor.AbstractDialog'); * @extends {goog.editor.Plugin} */ goog.editor.plugins.AbstractDialogPlugin = function(command) { - goog.editor.Plugin.call(this); + goog.editor.plugins.AbstractDialogPlugin.base(this, 'constructor'); + + /** + * The command that this plugin handles. + * @private {string} + */ this.command_ = command; + /** @private {function()} */ this.restoreScrollPosition_ = function() {}; + + /** + * The current dialog that was created and opened by this plugin. + * @private {?goog.ui.editor.AbstractDialog} + */ + this.dialog_ = null; + + /** + * Whether this plugin should reuse the same instance of the dialog each time + * execCommand is called or create a new one. + * @private {boolean} + */ + this.reuseDialog_ = false; + + /** + * Mutex to prevent recursive calls to disposeDialog_. + * @private {boolean} + */ + this.isDisposingDialog_ = false; + + /** + * SavedRange representing the selection before the dialog was opened. + * @private {?goog.dom.SavedRange} + */ + this.savedRange_ = null; }; goog.inherits(goog.editor.plugins.AbstractDialogPlugin, goog.editor.Plugin); @@ -272,47 +303,6 @@ goog.editor.plugins.AbstractDialogPlugin.prototype.disposeInternal = // *** Private implementation *********************************************** // -/** - * The command that this plugin handles. - * @type {string} - * @private - */ -goog.editor.plugins.AbstractDialogPlugin.prototype.command_; - - -/** - * The current dialog that was created and opened by this plugin. - * @type {goog.ui.editor.AbstractDialog} - * @private - */ -goog.editor.plugins.AbstractDialogPlugin.prototype.dialog_; - - -/** - * Whether this plugin should reuse the same instance of the dialog each time - * execCommand is called or create a new one. - * @type {boolean} - * @private - */ -goog.editor.plugins.AbstractDialogPlugin.prototype.reuseDialog_ = false; - - -/** - * Mutex to prevent recursive calls to disposeDialog_. - * @type {boolean} - * @private - */ -goog.editor.plugins.AbstractDialogPlugin.prototype.isDisposingDialog_ = false; - - -/** - * SavedRange representing the selection before the dialog was opened. - * @type {goog.dom.SavedRange} - * @private - */ -goog.editor.plugins.AbstractDialogPlugin.prototype.savedRange_; - - /** * Disposes of the dialog if needed. It is this abstract class' responsibility * to dispose of the dialog. The "if needed" refers to the fact this method