From fd481e8d44b9932d9054fc5f67ba62624bdb9421 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Mon, 22 Oct 2012 09:44:51 -0700 Subject: [PATCH] Update dirty flag in lightning bolt icon for all dirty flag change notification. --- src/LiveDevelopment/LiveDevelopment.js | 27 +++++++++++--------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index a5733db55da..e8291a25dbe 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -501,27 +501,22 @@ define(function LiveDevelopment(require, exports, module) { /** Triggered by a document saved from the DocumentManager */ function _onDocumentSaved(event, doc) { - if (doc && Inspector.connected() && _classForDocument(doc) !== CSSDocument) { - if (agents.network && agents.network.wasURLRequested(doc.url)) { - // Reload HTML page - Inspector.Page.reload(); - - // Reload unsaved changes - _onReconnect(); - - // Set status back to active - _setStatus(STATUS_ACTIVE); - } + if (doc && Inspector.connected() && _classForDocument(doc) !== CSSDocument && + agents.network && agents.network.wasURLRequested(doc.url)) { + // Reload HTML page + Inspector.Page.reload(); + + // Reload unsaved changes + _onReconnect(); } } /** Triggered by a change in dirty flag from the DocumentManager */ function _onDirtyFlagChange(event, doc) { - if (Inspector.connected() && doc && doc.isDirty && _classForDocument(doc) !== CSSDocument) { - if (agents.network && agents.network.wasURLRequested(doc.url)) { - // Set status to out of sync - _setStatus(STATUS_OUT_OF_SYNC); - } + if (doc && Inspector.connected() && _classForDocument(doc) !== CSSDocument && + agents.network && agents.network.wasURLRequested(doc.url)) { + // Set status to out of sync if dirty. Otherwise, set it to active status. + _setStatus(doc.isDirty ? STATUS_OUT_OF_SYNC : STATUS_ACTIVE); } }