Skip to content

Commit

Permalink
Fix a problem when simulator reloading, unsaved css doesn't take effect
Browse files Browse the repository at this point in the history
  • Loading branch information
zhizhangchen committed Mar 26, 2013
1 parent 968995c commit a32c0fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/LiveDevelopment/Agents/CSSAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ define(function CSSAgent(require, exports, module) {
require("thirdparty/path-utils/path-utils.min");

var Inspector = require("LiveDevelopment/Inspector/Inspector");
var DocumentManager = require("document/DocumentManager");

var _load; // {$.Deferred} load promise
var _urlToStyle; // {url -> loaded} style definition
Expand All @@ -51,6 +52,7 @@ define(function CSSAgent(require, exports, module) {

// WebInspector Event: Runtime.loadEventFired
function _onLoadingFinished(event, res) {
var doc = DocumentManager.getCurrentDocument();
_urlToStyle = {};
Inspector.CSS.getAllStyleSheets(function onGetAllStyleSheets(res) {
var i, header;
Expand All @@ -59,7 +61,10 @@ define(function CSSAgent(require, exports, module) {
_urlToStyle[_canonicalize(header.sourceURL)] = header;
}
_load.resolve();
if (doc.extension === "css")
reloadCSSForDocument(doc);
});

}

/** Get a style sheet for a url
Expand Down

0 comments on commit a32c0fb

Please sign in to comment.