You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cause of the browser refresh in #1886 is that _onDocumentSaved() thinks the Document being saved is an HTML Document, so an HTML live reload is triggered. But in reality, the Document being saved is a CSS Document in an inline editor.
Previously the _onDocumentSaved() method assumed that the Document being saved was the one returned by _getCurrentDocument(). In the case when an inline editor's Document is saved, _getCurrentDocument() returns the Document of the primary editor instead of the inline editor.
The actual saved Document is passed along when the documentSaved event is triggered in Document.prototype.notifySaved():
$(exports).triggerHandler("documentSaved", this)
We just needed to accept the event data into _onDocumentSaved() and utilize it to determine the saved Document.
Note: An alternative solution would be to change the behavior of _getCurrentDocument() so that it returns the inline editor's Document, but I'm assuming we always want that to return the primary Document.
Issue by JakeStoeffler
Saturday Oct 20, 2012 at 05:03 GMT
Originally opened as adobe/brackets#1897
The cause of the browser refresh in #1886 is that
_onDocumentSaved()
thinks the Document being saved is an HTML Document, so an HTML live reload is triggered. But in reality, the Document being saved is a CSS Document in an inline editor.Previously the
_onDocumentSaved()
method assumed that the Document being saved was the one returned by_getCurrentDocument()
. In the case when an inline editor's Document is saved,_getCurrentDocument()
returns the Document of the primary editor instead of the inline editor.The actual saved Document is passed along when the
documentSaved
event is triggered inDocument.prototype.notifySaved()
:We just needed to accept the event data into
_onDocumentSaved()
and utilize it to determine the saved Document.Note: An alternative solution would be to change the behavior of
_getCurrentDocument()
so that it returns the inline editor's Document, but I'm assuming we always want that to return the primary Document.JakeStoeffler included the following code: https://github.com/adobe/brackets/pull/1897/commits
The text was updated successfully, but these errors were encountered: