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 #1819 from adobe/rlim/live-development-issues
Browse files Browse the repository at this point in the history
Update live preview icon for any document that does not have .css extens...
  • Loading branch information
gruehle committed Oct 12, 2012
2 parents 5eddb2a + a6ad852 commit ec7a30c
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/LiveDevelopment/LiveDevelopment.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,6 @@ define(function LiveDevelopment(require, exports, module) {
}
}

/** Determine whether the given document is an HTML file
* by checking its extension.
* @param {Document} document to check
* @return {boolean} true if the given document's extension has "htm", false otherwise.
*/
function _isHTMLDocument(doc) {
return (doc && doc.extension && doc.extension.indexOf("htm") !== -1);
}

/**
* Removes the given CSS/JSDocument from _relatedDocuments. Signals that the
* given file is no longer associated with the HTML document that is live (e.g.
Expand Down Expand Up @@ -331,7 +322,7 @@ define(function LiveDevelopment(require, exports, module) {
status = STATUS_ACTIVE;

_openDocument(doc, editor);
if (doc.isDirty && _isHTMLDocument(doc)) {
if (doc.isDirty && _classForDocument(doc) !== CSSDocument) {
status = STATUS_OUT_OF_SYNC;
}
_setStatus(status);
Expand Down Expand Up @@ -501,7 +492,7 @@ define(function LiveDevelopment(require, exports, module) {
}
}

if (doc.isDirty && _isHTMLDocument(doc)) {
if (doc.isDirty && _classForDocument(doc) !== CSSDocument) {
status = STATUS_OUT_OF_SYNC;
}
_setStatus(status);
Expand All @@ -511,8 +502,8 @@ define(function LiveDevelopment(require, exports, module) {
/** Triggered by a document saved from the DocumentManager */
function _onDocumentSaved() {
var doc = _getCurrentDocument();

if (doc && _classForDocument(doc) !== CSSDocument && Inspector.connected()) {
if (doc && Inspector.connected() && _classForDocument(doc) !== CSSDocument) {
if (agents.network && agents.network.wasURLRequested(doc.url)) {
// Reload HTML page
Inspector.Page.reload();
Expand All @@ -528,7 +519,7 @@ define(function LiveDevelopment(require, exports, module) {

/** Triggered by a change in dirty flag from the DocumentManager */
function _onDirtyFlagChange(event, doc) {
if (doc && doc.isDirty && _isHTMLDocument(doc) && Inspector.connected()) {
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);
Expand Down

0 comments on commit ec7a30c

Please sign in to comment.