Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1945)

Unified Diff: Source/devtools/front_end/components/InspectorView.js

Issue 303783002: [DevTools] Beautified device counter icon. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed style Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/components/InspectorView.js
diff --git a/Source/devtools/front_end/components/InspectorView.js b/Source/devtools/front_end/components/InspectorView.js
index 10d197e398ee93a0fa6c206254bb411b72f37396..2ad7eac3a47cad9482a8f34d46e48e414c637989 100644
--- a/Source/devtools/front_end/components/InspectorView.js
+++ b/Source/devtools/front_end/components/InspectorView.js
@@ -63,6 +63,7 @@ WebInspector.InspectorView = function()
if (WebInspector.experimentsSettings.devicesPanel.isEnabled()) {
this._remoteDeviceCountElement = this._rightToolbarElement.createChild("div", "hidden");
this._remoteDeviceCountElement.addEventListener("click", this.showViewInDrawer.bind(this, "devices"), false);
+ this._remoteDeviceCountElement.id = "remote-device-count";
WebInspector.inspectorFrontendEventSink.addEventListener(WebInspector.InspectorView.Events.DeviceCountChanged, this._onDeviceCountChanged, this);
}
@@ -465,7 +466,10 @@ WebInspector.InspectorView.prototype = {
*/
_onDeviceCountChanged: function(event)
{
- var count = /** @type {number} */(event.data);
+ var count = /** @type {number} */ (event.data);
+ if (count === this.deviceCount_)
+ return;
+ this.deviceCount_ = count;
this._remoteDeviceCountElement.classList.toggle("hidden", !count);
this._remoteDeviceCountElement.removeChildren();
this._createImagedCounterElementIfNeeded(this._remoteDeviceCountElement, count, "device-count", "device-icon-small");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698