Changeset 291628 in webkit
- Timestamp:
- Mar 22, 2022 10:35:06 AM (4 months ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Views/InlineSwatch.js (modified) (7 diffs)
-
UserInterface/Views/SpreadsheetStyleProperty.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r291466 r291628 1 2022-03-22 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: Inline swatch popovers should hide when inline swatches are removed 4 https://bugs.webkit.org/show_bug.cgi?id=235047 5 <rdar://problem/87687975> 6 7 Reviewed by Patrick Angle. 8 9 * UserInterface/Views/InlineSwatch.js: 10 (WI.InlineSwatch): 11 (WI.InlineSwatch.prototype.dismissPopover): 12 (WI.InlineSwatch.prototype._presentPopover): 13 14 * UserInterface/Views/SpreadsheetStyleProperty.js: 15 (WI.SpreadsheetStyleProperty.prototype.detached): 16 (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit): 17 (WI.SpreadsheetStyleProperty.prototype._renderValue): 18 (WI.SpreadsheetStyleProperty.prototype._createInlineSwatch): 19 1 20 2022-03-17 Nikita Vasilyev <nvasilyev@apple.com> 2 21 -
trunk/Source/WebInspectorUI/UserInterface/Views/InlineSwatch.js
r286885 r291628 106 106 this._valueEditor = null; 107 107 this._readOnly = readOnly; 108 this._popover = null; 108 109 109 110 this._updateSwatch(); … … 134 135 this._shiftClickColorEnabled = !!value; 135 136 this._updateSwatch(true); 137 } 138 139 dismissPopover() 140 { 141 this._popover?.dismiss(); 136 142 } 137 143 … … 255 261 value = this._fallbackValue(); 256 262 257 letpopover = new WI.Popover(this);258 259 popover.windowResizeHandler = () => {260 this._presentPopover( popover);263 this._popover = new WI.Popover(this); 264 265 this._popover.windowResizeHandler = () => { 266 this._presentPopover(); 261 267 }; 262 268 … … 283 289 this._valueEditor.addEventListener(WI.GradientEditor.Event.ColorPickerToggled, function(event) { 284 290 this.update(); 285 }, popover);291 }, this._popover); 286 292 break; 287 293 … … 320 326 }); 321 327 this._valueEditor.codeMirror.on("update", () => { 322 popover.update();328 this._popover.update(); 323 329 }); 324 330 break; … … 328 334 return; 329 335 330 popover.content = this._valueEditor.element;331 this._presentPopover( popover);336 this._popover.content = this._valueEditor.element; 337 this._presentPopover(this._popover); 332 338 333 339 this.dispatchEventToListeners(WI.InlineSwatch.Event.Activated); … … 409 415 } 410 416 411 _presentPopover( popover)417 _presentPopover() 412 418 { 413 419 let bounds = WI.Rect.rectFromClientRect(this._swatchElement.getBoundingClientRect()); 414 popover.present(bounds.pad(2), [WI.RectEdge.MAX_Y, WI.RectEdge.MIN_Y, WI.RectEdge.MIN_X]);420 this._popover.present(bounds.pad(2), [WI.RectEdge.MAX_Y, WI.RectEdge.MIN_Y, WI.RectEdge.MIN_X]); 415 421 } 416 422 -
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js
r287409 r291628 53 53 this._hasInvalidVariableValue = false; 54 54 this._cssDocumentationPopover = null; 55 this._activeInlineSwatch = null; 55 56 56 57 this.update(); … … 135 136 if (this._valueTextField) 136 137 this._valueTextField.detached(); 138 139 this._activeInlineSwatch?.dismissPopover(); 140 this._activeInlineSwatch = null; 141 142 this._cssDocumentationPopover?.dismiss(); 143 this._cssDocumentationPopover = null; 137 144 } 138 145 … … 387 394 388 395 this._cssDocumentationPopover?.dismiss(); 396 this._cssDocumentationPopover = null; 389 397 390 398 if (direction === "forward") { … … 483 491 { 484 492 this._hasInvalidVariableValue = false; 493 this._activeInlineSwatch = null; 485 494 486 495 const maxValueLength = 150; … … 604 613 } 605 614 606 if (this._delegate && typeof this._delegate.stylePropertyInlineSwatchActivated === "function") { 607 swatch.addEventListener(WI.InlineSwatch.Event.Activated, function(event) { 608 this._delegate.stylePropertyInlineSwatchActivated(); 609 }, this); 610 } 615 swatch.addEventListener(WI.InlineSwatch.Event.Activated, function(event) { 616 this._activeInlineSwatch = swatch; 617 this._delegate?.stylePropertyInlineSwatchActivated(); 618 }, this); 611 619 612 620 if (this._delegate && typeof this._delegate.stylePropertyInlineSwatchDeactivated === "function") {
Note: See TracChangeset
for help on using the changeset viewer.