Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1797 from adobe/randy/live-preview-unsaved-css
Browse files Browse the repository at this point in the history
reload unsaved changes to related files
  • Loading branch information
RaymondLim committed Oct 8, 2012
2 parents be014e9 + 2bf1f1e commit 1d15df2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/LiveDevelopment/LiveDevelopment.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,13 @@ define(function LiveDevelopment(require, exports, module) {
_setStatus(STATUS_INACTIVE);
}

function _onReconnect() {
unloadAgents();
var promises = loadAgents();
_setStatus(STATUS_LOADING_AGENTS);
$.when.apply(undefined, promises).then(_onLoad, _onError);
}

/** Open the Connection and go live */
function open() {
var result = new $.Deferred(),
Expand Down Expand Up @@ -485,7 +492,11 @@ define(function LiveDevelopment(require, exports, module) {

if (doc && doc.extension !== "css" && Inspector.connected()) {
if (agents.network && agents.network.wasURLRequested(doc.url)) {
// Reload HTML page
Inspector.Page.reload();

// Reload unsaved changes
_onReconnect();
}
}
}
Expand Down

0 comments on commit 1d15df2

Please sign in to comment.