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

Commit

Permalink
Attach editor to LiveCSSDocument during creation
Browse files Browse the repository at this point in the history
Fix #10516. Attach editor to LiveCSSDocument during its creation since
lack of editor instance makes live highlighting not work when
LivePreview session is being started from a CSS document.
  • Loading branch information
sebaslv committed Feb 4, 2015
1 parent b2df944 commit 56d139b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/LiveDevelopment/LiveDevMultiBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ define(function (require, exports, module) {
docPromise.done(function (doc) {
if ((_classForDocument(doc) === LiveCSSDocument) &&
(!_liveDocument || (doc !== _liveDocument.doc))) {
var liveDoc = _createLiveDocument(doc, null, roots);
var liveDoc = _createLiveDocument(doc, doc._masterEditor, roots);
if (liveDoc) {
_server.add(liveDoc);
_relatedDocuments[doc.url] = liveDoc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ define(function LiveCSSDocumentModule(require, exports, module) {

this.doc.on("change.LiveCSSDocument", this.onChange);
this.doc.on("deleted.LiveCSSDocument", this.onDeleted);
if (editor) {
this._attachToEditor(editor);
}
};

LiveCSSDocument.prototype = Object.create(LiveDocument.prototype);
Expand Down

0 comments on commit 56d139b

Please sign in to comment.