Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Fix for #1886 #1846

Open
core-ai-bot opened this issue Aug 29, 2021 · 1 comment
Open

[CLOSED] Fix for #1886 #1846

core-ai-bot opened this issue Aug 29, 2021 · 1 comment

Comments

@core-ai-bot
Copy link
Member

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 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.


JakeStoeffler included the following code: https://github.com/adobe/brackets/pull/1897/commits

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Saturday Oct 20, 2012 at 06:54 GMT


Looks good! Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant