OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
8 * @implements {WebInspector.OverridesSupport.PageResizer} | 8 * @implements {WebInspector.OverridesSupport.PageResizer} |
9 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder | 9 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder |
10 */ | 10 */ |
11 WebInspector.ResponsiveDesignView = function(inspectedPagePlaceholder) | 11 WebInspector.ResponsiveDesignView = function(inspectedPagePlaceholder) |
12 { | 12 { |
13 WebInspector.VBox.call(this); | 13 WebInspector.VBox.call(this); |
14 this.registerRequiredCSS("responsiveDesignView.css"); | 14 this.registerRequiredCSS("responsiveDesignView.css"); |
| 15 this.element.classList.add("overflow-hidden"); |
15 | 16 |
16 this._responsiveDesignContainer = new WebInspector.VBox(); | 17 this._responsiveDesignContainer = new WebInspector.VBox(); |
17 | 18 |
18 this._createToolbar(); | 19 this._createToolbar(); |
19 this._warningMessage = this._responsiveDesignContainer.element.createChild("
div", "responsive-design-warning hidden"); | 20 this._warningMessage = this._responsiveDesignContainer.element.createChild("
div", "responsive-design-warning hidden"); |
20 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport
.Events.OverridesWarningUpdated, this._overridesWarningUpdated, this); | 21 WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport
.Events.OverridesWarningUpdated, this._overridesWarningUpdated, this); |
21 | 22 |
22 this._canvasContainer = new WebInspector.View(); | 23 this._canvasContainer = new WebInspector.View(); |
23 this._canvasContainer.element.classList.add("responsive-design"); | 24 this._canvasContainer.element.classList.add("responsive-design"); |
24 this._canvasContainer.show(this._responsiveDesignContainer.element); | 25 this._canvasContainer.show(this._responsiveDesignContainer.element); |
(...skipping 13 matching lines...) Expand all Loading... |
38 this._heightSlider = this._heightSliderContainer.createChild("div", "respons
ive-design-slider-thumb"); | 39 this._heightSlider = this._heightSliderContainer.createChild("div", "respons
ive-design-slider-thumb"); |
39 this._heightSlider.createChild("div", "responsive-design-thumb-handle"); | 40 this._heightSlider.createChild("div", "responsive-design-thumb-handle"); |
40 this._createResizer(this._heightSlider, true); | 41 this._createResizer(this._heightSlider, true); |
41 | 42 |
42 this._inspectedPagePlaceholder = inspectedPagePlaceholder; | 43 this._inspectedPagePlaceholder = inspectedPagePlaceholder; |
43 inspectedPagePlaceholder.show(this.element); | 44 inspectedPagePlaceholder.show(this.element); |
44 | 45 |
45 this._enabled = false; | 46 this._enabled = false; |
46 | 47 |
47 WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.Zo
omChanged, this._onZoomChanged, this); | 48 WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.Zo
omChanged, this._onZoomChanged, this); |
48 WebInspector.settings.responsiveDesignMode.addChangeListener(this._responsiv
eDesignModeChanged, this); | 49 WebInspector.settings.responsiveDesign.enabled.addChangeListener(this._respo
nsiveDesignEnabledChanged, this); |
49 WebInspector.overridesSupport.settings.emulateViewport.addChangeListener(thi
s._maybeEnableResponsiveDesign, this); | 50 WebInspector.overridesSupport.settings.emulateViewport.addChangeListener(thi
s._maybeEnableResponsiveDesign, this); |
50 WebInspector.overridesSupport.settings.emulateTouchEvents.addChangeListener(
this._maybeEnableResponsiveDesign, this); | 51 WebInspector.overridesSupport.settings.emulateTouchEvents.addChangeListener(
this._maybeEnableResponsiveDesign, this); |
51 WebInspector.overridesSupport.settings.overrideDeviceResolution.addChangeLis
tener(this._maybeEnableResponsiveDesign, this); | 52 WebInspector.overridesSupport.settings.overrideDeviceResolution.addChangeLis
tener(this._maybeEnableResponsiveDesign, this); |
52 this._responsiveDesignModeChanged(); | 53 this._responsiveDesignEnabledChanged(); |
53 this._overridesWarningUpdated(); | 54 this._overridesWarningUpdated(); |
54 }; | 55 }; |
55 | 56 |
56 // Measured in DIP. | 57 // Measured in DIP. |
57 WebInspector.ResponsiveDesignView.SliderWidth = 19; | 58 WebInspector.ResponsiveDesignView.SliderWidth = 19; |
58 WebInspector.ResponsiveDesignView.RulerWidth = 20; | 59 WebInspector.ResponsiveDesignView.RulerWidth = 20; |
59 WebInspector.ResponsiveDesignView.ToolbarHeight = 23; | |
60 | 60 |
61 WebInspector.ResponsiveDesignView.prototype = { | 61 WebInspector.ResponsiveDesignView.prototype = { |
62 _maybeEnableResponsiveDesign: function() | 62 _maybeEnableResponsiveDesign: function() |
63 { | 63 { |
64 if (this._enabled) | 64 if (this._enabled) |
65 return; | 65 return; |
66 if (WebInspector.overridesSupport.settings.emulateViewport.get() || | 66 if (WebInspector.overridesSupport.settings.emulateViewport.get() || |
67 WebInspector.overridesSupport.settings.emulateTouchEvents.get()
|| | 67 WebInspector.overridesSupport.settings.emulateTouchEvents.get()
|| |
68 WebInspector.overridesSupport.settings.overrideDeviceResolution.
get()) { | 68 WebInspector.overridesSupport.settings.overrideDeviceResolution.
get()) { |
69 WebInspector.settings.responsiveDesignMode.set(true); | 69 WebInspector.settings.responsiveDesign.enabled.set(true); |
70 } | 70 } |
71 }, | 71 }, |
72 | 72 |
73 _invalidateCache: function() | 73 _invalidateCache: function() |
74 { | 74 { |
75 delete this._cachedScale; | 75 delete this._cachedScale; |
76 delete this._cachedCssCanvasWidth; | 76 delete this._cachedCssCanvasWidth; |
77 delete this._cachedCssCanvasHeight; | 77 delete this._cachedCssCanvasHeight; |
78 delete this._cachedCssHeight; | 78 delete this._cachedCssHeight; |
79 delete this._cachedCssWidth; | 79 delete this._cachedCssWidth; |
80 delete this._cachedZoomFactor; | 80 delete this._cachedZoomFactor; |
81 delete this._availableSize; | 81 delete this._availableSize; |
82 }, | 82 }, |
83 | 83 |
84 _responsiveDesignModeChanged: function() | 84 _responsiveDesignEnabledChanged: function() |
85 { | 85 { |
86 var enabled = WebInspector.settings.responsiveDesignMode.get(); | 86 var enabled = WebInspector.settings.responsiveDesign.enabled.get(); |
87 if (enabled && !this._enabled) { | 87 if (enabled && !this._enabled) { |
88 this._invalidateCache(); | 88 this._invalidateCache(); |
89 this._ignoreResize = true; | 89 this._ignoreResize = true; |
90 this._enabled = true; | 90 this._enabled = true; |
91 this._inspectedPagePlaceholder.clearMinimumSizeAndMargins(); | 91 this._inspectedPagePlaceholder.clearMinimumSizeAndMargins(); |
92 this._inspectedPagePlaceholder.show(this._pageContainer); | 92 this._inspectedPagePlaceholder.show(this._pageContainer); |
93 this._responsiveDesignContainer.show(this.element); | 93 this._responsiveDesignContainer.show(this.element); |
94 this.update(this._dipWidth, this._dipHeight, this._scale); | 94 this.update(this._dipWidth || 0, this._dipHeight || 0, this._scale |
| 0); |
95 delete this._ignoreResize; | 95 delete this._ignoreResize; |
96 } else if (!enabled && this._enabled) { | 96 } else if (!enabled && this._enabled) { |
97 this._invalidateCache(); | 97 this._invalidateCache(); |
98 this._ignoreResize = true; | 98 this._ignoreResize = true; |
99 this._enabled = false; | 99 this._enabled = false; |
100 this._scale = 0; | 100 this._scale = 0; |
101 this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins(); | 101 this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins(); |
102 this._responsiveDesignContainer.detach(); | 102 this._responsiveDesignContainer.detach(); |
103 this._inspectedPagePlaceholder.show(this.element); | 103 this._inspectedPagePlaceholder.show(this.element); |
104 delete this._ignoreResize; | 104 delete this._ignoreResize; |
(...skipping 16 matching lines...) Expand all Loading... |
121 this._updateUI(); | 121 this._updateUI(); |
122 }, | 122 }, |
123 | 123 |
124 /** | 124 /** |
125 * WebInspector.OverridesSupport.PageResizer override. | 125 * WebInspector.OverridesSupport.PageResizer override. |
126 * @return {!Size} | 126 * @return {!Size} |
127 */ | 127 */ |
128 availableDipSize: function() | 128 availableDipSize: function() |
129 { | 129 { |
130 if (typeof this._availableSize === "undefined") { | 130 if (typeof this._availableSize === "undefined") { |
| 131 this._responsiveDesignEnabledChanged(); |
131 var zoomFactor = WebInspector.zoomManager.zoomFactor(); | 132 var zoomFactor = WebInspector.zoomManager.zoomFactor(); |
132 var rect = this.element.getBoundingClientRect(); | 133 var rect = this._canvasContainer.element.getBoundingClientRect(); |
133 this._availableSize = new Size(rect.width * zoomFactor - WebInspecto
r.ResponsiveDesignView.RulerWidth, | 134 this._availableSize = new Size(rect.width * zoomFactor - WebInspecto
r.ResponsiveDesignView.RulerWidth, |
134 rect.height * zoomFactor - WebInspect
or.ResponsiveDesignView.RulerWidth - WebInspector.ResponsiveDesignView.ToolbarHe
ight); | 135 rect.height * zoomFactor - WebInspect
or.ResponsiveDesignView.RulerWidth); |
135 } | 136 } |
136 return this._availableSize; | 137 return this._availableSize; |
137 }, | 138 }, |
138 | 139 |
139 /** | 140 /** |
140 * @param {!Element} element | 141 * @param {!Element} element |
141 * @param {boolean} vertical | 142 * @param {boolean} vertical |
142 * @return {!WebInspector.ResizerWidget} | 143 * @return {!WebInspector.ResizerWidget} |
143 */ | 144 */ |
144 _createResizer: function(element, vertical) | 145 _createResizer: function(element, vertical) |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 368 |
368 onResize: function() | 369 onResize: function() |
369 { | 370 { |
370 if (!this._enabled || this._ignoreResize) | 371 if (!this._enabled || this._ignoreResize) |
371 return; | 372 return; |
372 var oldSize = this._availableSize; | 373 var oldSize = this._availableSize; |
373 delete this._availableSize; | 374 delete this._availableSize; |
374 if (!this.availableDipSize().isEqual(oldSize)) | 375 if (!this.availableDipSize().isEqual(oldSize)) |
375 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResi
zer.Events.AvailableSizeChanged); | 376 this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResi
zer.Events.AvailableSizeChanged); |
376 this._updateUI(); | 377 this._updateUI(); |
| 378 this._inspectedPagePlaceholder.onResize(); |
377 }, | 379 }, |
378 | 380 |
379 _onZoomChanged: function() | 381 _onZoomChanged: function() |
380 { | 382 { |
381 this._updateUI(); | 383 this._updateUI(); |
382 }, | 384 }, |
383 | 385 |
384 _createToolbar: function() | 386 _createToolbar: function() |
385 { | 387 { |
386 this._toolbarElement = this._responsiveDesignContainer.element.createChi
ld("div", "responsive-design-toolbar"); | 388 var toolbarElement = this._responsiveDesignContainer.element.createChild
("div", "responsive-design-toolbar"); |
| 389 this._toolbarSection = toolbarElement.createChild("div", "responsive-des
ign-composite-section hbox"); |
| 390 |
| 391 this._expandedDeviceSection = document.createElementWithClass("div", "re
sponsive-design-composite-section vbox"); |
| 392 this._expandedScreenTouchSection = document.createElementWithClass("div"
, "responsive-design-composite-section hbox"); |
| 393 |
| 394 this._expandSection = document.createElementWithClass("div", "responsive
-design-section vbox"); |
| 395 WebInspector.settings.responsiveDesign.toolbarExpanded = WebInspector.se
ttings.createSetting("responsiveDesign.toolbarExpanded", false); |
| 396 this._expandButton = this._expandSection.createChild("div", "responsive-
design-expand"); |
| 397 this._expandButton.createChild("div", "responsive-design-icon responsive
-design-icon-expand"); |
| 398 this._expandButton.createChild("span"); |
| 399 this._expandButton.addEventListener("click", this._toggleToolbarExpanded
.bind(this)); |
| 400 WebInspector.settings.responsiveDesign.toolbarExpanded.addChangeListener
(this._toolbarExpandedChanged, this); |
387 | 401 |
388 // Device | 402 // Device |
389 var sectionElement = this._toolbarElement.createChild("div", "responsive
-design-section"); | 403 this._deviceSection = document.createElementWithClass("div", "responsive
-design-section"); |
390 var deviceLabel = sectionElement.createChild("label"); | 404 var deviceLabel = this._deviceSection.createChild("label"); |
391 var deviceCheckbox = deviceLabel.createChild("input"); | 405 var deviceCheckbox = deviceLabel.createChild("input"); |
392 deviceCheckbox.type = "checkbox"; | 406 deviceCheckbox.type = "checkbox"; |
393 deviceLabel.createTextChild(WebInspector.UIString("Device")); | 407 deviceLabel.createTextChild(WebInspector.UIString("Device")); |
394 deviceLabel.title = WebInspector.UIString("Emulate device"); | 408 deviceLabel.title = WebInspector.UIString("Emulate device"); |
395 deviceCheckbox.addEventListener("change", deviceChecked, false); | 409 deviceCheckbox.addEventListener("change", deviceChecked, false); |
396 | 410 |
397 function deviceChecked() | 411 function deviceChecked() |
398 { | 412 { |
399 if (deviceCheckbox.checked) { | 413 if (deviceCheckbox.checked) { |
400 var option = deviceSelect.options[deviceSelect.selectedIndex]; | 414 var option = deviceSelect.options[deviceSelect.selectedIndex]; |
401 WebInspector.overridesSupport.emulateDevice(option.metrics, opti
on.userAgent); | 415 WebInspector.overridesSupport.emulateDevice(option.metrics, opti
on.userAgent); |
402 } else { | 416 } else { |
403 WebInspector.overridesSupport.resetEmulatedDevice(); | 417 WebInspector.overridesSupport.resetEmulatedDevice(); |
404 } | 418 } |
405 } | 419 } |
406 | 420 |
407 var deviceSelect = WebInspector.overridesSupport.createDeviceSelect(docu
ment); | 421 var deviceSelect = WebInspector.overridesSupport.createDeviceSelect(docu
ment); |
408 sectionElement.appendChild(deviceSelect); | 422 this._deviceSection.appendChild(deviceSelect); |
409 deviceSelect.addEventListener("change", emulateDevice, false); | 423 deviceSelect.addEventListener("change", emulateDevice, false); |
410 | 424 |
411 function emulateDevice() | 425 function emulateDevice() |
412 { | 426 { |
413 var option = deviceSelect.options[deviceSelect.selectedIndex]; | 427 var option = deviceSelect.options[deviceSelect.selectedIndex]; |
414 WebInspector.overridesSupport.emulateDevice(option.metrics, option.u
serAgent); | 428 WebInspector.overridesSupport.emulateDevice(option.metrics, option.u
serAgent); |
415 } | 429 } |
416 | 430 |
417 updateDeviceCheckboxStatus(); | 431 updateDeviceCheckboxStatus(); |
418 | 432 |
419 WebInspector.overridesSupport.settings.emulateViewport.addChangeListener
(updateDeviceCheckboxStatus); | 433 WebInspector.overridesSupport.settings.emulateViewport.addChangeListener
(updateDeviceCheckboxStatus); |
420 WebInspector.overridesSupport.settings.emulateTouchEvents.addChangeListe
ner(updateDeviceCheckboxStatus); | 434 WebInspector.overridesSupport.settings.emulateTouchEvents.addChangeListe
ner(updateDeviceCheckboxStatus); |
421 WebInspector.overridesSupport.settings.overrideDeviceResolution.addChang
eListener(updateDeviceCheckboxStatus); | 435 WebInspector.overridesSupport.settings.overrideDeviceResolution.addChang
eListener(updateDeviceCheckboxStatus); |
422 | 436 |
423 function updateDeviceCheckboxStatus() | 437 function updateDeviceCheckboxStatus() |
424 { | 438 { |
425 deviceCheckbox.checked = WebInspector.overridesSupport.settings.emul
ateViewport.get() && | 439 deviceCheckbox.checked = WebInspector.overridesSupport.settings.emul
ateViewport.get() && |
426 WebInspector.overridesSupport.settings.emulateTouchEvents.get()
&& | 440 WebInspector.overridesSupport.settings.emulateTouchEvents.get()
&& |
427 WebInspector.overridesSupport.settings.overrideDeviceResolution.
get(); | 441 WebInspector.overridesSupport.settings.overrideDeviceResolution.
get(); |
428 } | 442 } |
429 | 443 |
430 // Screen | 444 // Screen |
431 sectionElement = this._toolbarElement.createChild("div", "responsive-des
ign-section"); | 445 this._screenSection = document.createElementWithClass("div", "responsive
-design-section"); |
432 sectionElement.appendChild(WebInspector.SettingsUI.createSettingCheckbox
("Screen", WebInspector.overridesSupport.settings.overrideDeviceResolution, true
)); | 446 this._screenSection.appendChild(WebInspector.SettingsUI.createSettingChe
ckbox("Screen", WebInspector.overridesSupport.settings.overrideDeviceResolution,
true)); |
433 | 447 |
434 var fieldsetElement = WebInspector.SettingsUI.createSettingFieldset(WebI
nspector.overridesSupport.settings.overrideDeviceResolution); | 448 var fieldsetElement = WebInspector.SettingsUI.createSettingFieldset(WebI
nspector.overridesSupport.settings.overrideDeviceResolution); |
435 sectionElement.appendChild(fieldsetElement); | 449 this._screenSection.appendChild(fieldsetElement); |
436 fieldsetElement.createChild("div", "responsive-design-icon responsive-de
sign-icon-resolution").title = WebInspector.UIString("Screen resolution"); | 450 fieldsetElement.createChild("div", "responsive-design-icon responsive-de
sign-icon-resolution").title = WebInspector.UIString("Screen resolution"); |
437 | 451 |
438 fieldsetElement.appendChild(WebInspector.SettingsUI.createSettingInputFi
eld("", WebInspector.overridesSupport.settings.deviceWidth, true, 4, "3em", WebI
nspector.OverridesSupport.integerInputValidator, true)); | 452 fieldsetElement.appendChild(WebInspector.SettingsUI.createSettingInputFi
eld("", WebInspector.overridesSupport.settings.deviceWidth, true, 4, "3em", WebI
nspector.OverridesSupport.integerInputValidator, true)); |
439 fieldsetElement.appendChild(document.createTextNode(" \u00D7 ")); | 453 fieldsetElement.appendChild(document.createTextNode(" \u00D7 ")); |
440 fieldsetElement.appendChild(WebInspector.SettingsUI.createSettingInputFi
eld("", WebInspector.overridesSupport.settings.deviceHeight, true, 4, "3em", Web
Inspector.OverridesSupport.integerInputValidator, true)); | 454 fieldsetElement.appendChild(WebInspector.SettingsUI.createSettingInputFi
eld("", WebInspector.overridesSupport.settings.deviceHeight, true, 4, "3em", Web
Inspector.OverridesSupport.integerInputValidator, true)); |
441 | 455 |
442 this._swapDimensionsElement = fieldsetElement.createChild("button", "res
ponsive-design-icon responsive-design-icon-swap"); | 456 this._swapDimensionsElement = fieldsetElement.createChild("button", "res
ponsive-design-icon responsive-design-icon-swap"); |
443 this._swapDimensionsElement.title = WebInspector.UIString("Swap dimensio
ns"); | 457 this._swapDimensionsElement.title = WebInspector.UIString("Swap dimensio
ns"); |
444 this._swapDimensionsElement.addEventListener("click", WebInspector.overr
idesSupport.swapDimensions.bind(WebInspector.overridesSupport), false); | 458 this._swapDimensionsElement.addEventListener("click", WebInspector.overr
idesSupport.swapDimensions.bind(WebInspector.overridesSupport), false); |
445 | 459 |
446 fieldsetElement.createChild("div", "responsive-design-icon responsive-de
sign-icon-dpr").title = WebInspector.UIString("Device pixel ratio"); | 460 fieldsetElement.createChild("div", "responsive-design-icon responsive-de
sign-icon-dpr").title = WebInspector.UIString("Device pixel ratio"); |
447 fieldsetElement.appendChild(WebInspector.SettingsUI.createSettingInputFi
eld("", WebInspector.overridesSupport.settings.deviceScaleFactor, true, 4, "2.5e
m", WebInspector.OverridesSupport.doubleInputValidator, true)); | 461 fieldsetElement.appendChild(WebInspector.SettingsUI.createSettingInputFi
eld("", WebInspector.overridesSupport.settings.deviceScaleFactor, true, 4, "2.5e
m", WebInspector.OverridesSupport.doubleInputValidator, true)); |
448 | 462 |
449 // Touch and viewport | 463 // Touch and viewport |
450 sectionElement = this._toolbarElement.createChild("div", "responsive-des
ign-section"); | 464 this._touchSection = document.createElementWithClass("div", "responsive-
design-section"); |
451 sectionElement.appendChild(WebInspector.SettingsUI.createSettingCheckbox
(WebInspector.UIString("Touch"), WebInspector.overridesSupport.settings.emulateT
ouchEvents, true)); | 465 this._touchSection.appendChild(WebInspector.SettingsUI.createSettingChec
kbox(WebInspector.UIString("Touch"), WebInspector.overridesSupport.settings.emul
ateTouchEvents, true)); |
452 sectionElement.appendChild(WebInspector.SettingsUI.createSettingCheckbox
(WebInspector.UIString("Viewport"), WebInspector.overridesSupport.settings.emula
teViewport, true)); | 466 this._touchSection.appendChild(WebInspector.SettingsUI.createSettingChec
kbox(WebInspector.UIString("Viewport"), WebInspector.overridesSupport.settings.e
mulateViewport, true)); |
| 467 |
| 468 // User agent. |
| 469 this._userAgentSection = document.createElementWithClass("div", "respons
ive-design-composite-section vbox solid"); |
| 470 var userAgentRow = this._userAgentSection.createChild("div", "responsive
-design-composite-section hbox solid"); |
| 471 userAgentRow.createChild("div", "responsive-design-section hbox").append
Child(WebInspector.SettingsUI.createSettingCheckbox("User Agent", WebInspector.o
verridesSupport.settings.overrideUserAgent, true)); |
| 472 var userAgentSelectAndInput = WebInspector.overridesSupport.createUserAg
entSelectAndInput(document); |
| 473 userAgentRow.createChild("div", "responsive-design-section hbox").append
Child(userAgentSelectAndInput.select); |
| 474 this._userAgentSection.createChild("div", "responsive-design-section hbo
x").appendChild(userAgentSelectAndInput.input); |
| 475 |
| 476 this._toolbarExpandedChanged(); |
| 477 }, |
| 478 |
| 479 _toggleToolbarExpanded: function() |
| 480 { |
| 481 WebInspector.settings.responsiveDesign.toolbarExpanded.set(!WebInspector
.settings.responsiveDesign.toolbarExpanded.get()); |
| 482 }, |
| 483 |
| 484 _toolbarExpandedChanged: function() |
| 485 { |
| 486 var expanded = WebInspector.settings.responsiveDesign.toolbarExpanded.ge
t(); |
| 487 this._expandButton.classList.toggle("expanded", expanded); |
| 488 this._expandButton.querySelector("span").textContent = WebInspector.UISt
ring(expanded ? "Collapse" : "Expand"); |
| 489 |
| 490 if (expanded) { |
| 491 this._expandedScreenTouchSection.setChildren([this._screenSection, t
his._touchSection]); |
| 492 this._expandedDeviceSection.setChildren([this._deviceSection, this._
expandedScreenTouchSection]); |
| 493 this._toolbarSection.setChildren([this._expandSection, this._expande
dDeviceSection, this._userAgentSection]); |
| 494 } else { |
| 495 this._toolbarSection.setChildren([this._expandSection, this._deviceS
ection, this._screenSection, this._touchSection]); |
| 496 } |
| 497 |
| 498 this.onResize(); |
453 }, | 499 }, |
454 | 500 |
455 _overridesWarningUpdated: function() | 501 _overridesWarningUpdated: function() |
456 { | 502 { |
457 var message = WebInspector.overridesSupport.warningMessage(); | 503 var message = WebInspector.overridesSupport.warningMessage(); |
458 if (this._warningMessage.textContent === message) | 504 if (this._warningMessage.textContent === message) |
459 return; | 505 return; |
460 this._warningMessage.classList.toggle("hidden", !message); | 506 this._warningMessage.classList.toggle("hidden", !message); |
461 this._warningMessage.textContent = message; | 507 this._warningMessage.textContent = message; |
462 this._invalidateCache(); | 508 this._invalidateCache(); |
463 this.onResize(); | 509 this.onResize(); |
464 }, | 510 }, |
465 | 511 |
466 __proto__: WebInspector.VBox.prototype | 512 __proto__: WebInspector.VBox.prototype |
467 }; | 513 }; |
OLD | NEW |