Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Allows AbstractDialogPlugin to be sealed, making subclasses compatibl…
Browse files Browse the repository at this point in the history
…e with goog.defineClass.

RELNOTES: n/a
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113878307
  • Loading branch information
joeltine committed Feb 4, 2016
1 parent 06aff2a commit f3fc479
Showing 1 changed file with 32 additions and 42 deletions.
74 changes: 32 additions & 42 deletions closure/goog/editor/plugins/abstractdialogplugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f3fc479

Please sign in to comment.