Skip to content
Permalink
Browse files
Web Inspector: Styles: Command-/ should toggle edited property
https://bugs.webkit.org/show_bug.cgi?id=194967
<rdar://problem/48329852>

Reviewed by Devin Rousso.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.commentOut):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertySelect):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.update):
(WI.SpreadsheetStyleProperty.prototype._toggle):
(WI.SpreadsheetStyleProperty.prototype._select):


Canonical link: https://commits.webkit.org/209386@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
NV committed Feb 26, 2019
1 parent b49b029 commit ebc08ad128340c1ed829b0ecda1496e5138f0508
Showing 4 changed files with 43 additions and 4 deletions.
@@ -1,3 +1,20 @@
2019-02-25 Nikita Vasilyev <nvasilyev@apple.com>

Web Inspector: Styles: Command-/ should toggle edited property
https://bugs.webkit.org/show_bug.cgi?id=194967
<rdar://problem/48329852>

Reviewed by Devin Rousso.

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.commentOut):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertySelect):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.update):
(WI.SpreadsheetStyleProperty.prototype._toggle):
(WI.SpreadsheetStyleProperty.prototype._select):

2019-02-25 Devin Rousso <drousso@apple.com>

Web Inspector: REGRESSION(r242018): Timelines shows no results
@@ -143,7 +143,6 @@ WI.CSSProperty = class CSSProperty extends WI.Object

commentOut(disabled)
{
console.assert(this._enabled === disabled, "CSS property is already " + (disabled ? "disabled" : "enabled"));
if (this._enabled === !disabled)
return;

@@ -450,6 +450,11 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd
}
}

spreadsheetStylePropertySelect(index)
{
this.selectProperties(index, index);
}

spreadsheetStylePropertyAddBlankPropertySoon(propertyView, {index})
{
if (isNaN(index))
@@ -67,6 +67,11 @@ WI.SpreadsheetStyleProperty = class SpreadsheetStyleProperty extends WI.Object
this._delegate.spreadsheetStylePropertyMouseEnter(event, this);
});

new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.CommandOrControl, WI.KeyboardShortcut.Key.Slash, () => {
this._toggle();
this._select();
}, this._element);

this._element.copyHandler = this;
}
}
@@ -156,9 +161,8 @@ WI.SpreadsheetStyleProperty = class SpreadsheetStyleProperty extends WI.Object
this._checkboxElement.tabIndex = -1;
this._checkboxElement.addEventListener("click", (event) => {
event.stopPropagation();
let disabled = !this._checkboxElement.checked;
this._property.commentOut(disabled);
this.update();
this._toggle();
console.assert(this._checkboxElement.checked === this._property.enabled);
});
}

@@ -408,6 +412,20 @@ WI.SpreadsheetStyleProperty = class SpreadsheetStyleProperty extends WI.Object

// Private

_toggle()
{
this._property.commentOut(this.property.enabled);
this.update();
}

_select()
{
if (this._delegate && this._delegate.spreadsheetStylePropertySelect) {
let index = parseInt(this._element.dataset.propertyIndex);
this._delegate.spreadsheetStylePropertySelect(index);
}
}

_isEditable()
{
return !this._readOnly && this._property.editable;

0 comments on commit ebc08ad

Please sign in to comment.