Bug 966242 - Get rid of flicker when rule view is refreshed;r=pbrosset

This commit is contained in:
Brian Grinstead 2014-06-05 07:53:45 -05:00
Родитель 1f23d32af8
Коммит a9161a7362
2 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -1469,24 +1469,26 @@ CssRuleView.prototype = {
/**
* Update the rules for the currently highlighted element.
*/
nodeChanged: function() {
refreshPanel: function() {
// Ignore refreshes during editing or when no element is selected.
if (this.isEditing || !this._elementStyle) {
return;
}
this._clearRules();
// Repopulate the element style.
this._populate();
this._populate(true);
},
_populate: function() {
_populate: function(clearRules = false) {
let elementStyle = this._elementStyle;
return this._elementStyle.populate().then(() => {
if (this._elementStyle != elementStyle) {
return;
}
if (clearRules) {
this._clearRules();
}
this._createEditors();
// Notify anyone that cares that we refreshed.

Просмотреть файл

@ -109,7 +109,7 @@ RuleViewTool.prototype = {
},
refresh: function RVT_refresh() {
this.view.nodeChanged();
this.view.refreshPanel();
},
destroy: function RVT_destroy() {