[Pkg-mozext-commits] [firebug] 31/56: Issue 7687: CodeMirror is broken in Nightly

David Prévot taffit at moszumanska.debian.org
Wed Nov 19 21:01:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firebug.

commit 786ed895866388e1f1128df580fca5a3b8db1e91
Author: Simon Lindholm <simon.lindholm10 at gmail.com>
Date:   Wed Oct 22 23:11:21 2014 +0200

    Issue 7687: CodeMirror is broken in Nightly
    
    https://code.google.com/p/fbug/issues/detail?id=7687
---
 extension/content/firebug/editor/sourceEditor.js | 38 ++++++++++--------------
 1 file changed, 15 insertions(+), 23 deletions(-)

diff --git a/extension/content/firebug/editor/sourceEditor.js b/extension/content/firebug/editor/sourceEditor.js
index 59383bb..3028343 100644
--- a/extension/content/firebug/editor/sourceEditor.js
+++ b/extension/content/firebug/editor/sourceEditor.js
@@ -191,24 +191,25 @@ SourceEditor.prototype =
         var self = this;
 
         // Create editor;
-        this.editorObject = contentView.CodeMirror(function(view)
+        var clone = this.cloneIntoCMScope.bind(this);
+        this.editorObject = contentView.CodeMirror(clone(function(view)
         {
             Trace.sysout("sourceEditor.onEditorCreate;");
 
             parentNode.appendChild(view);
             self.view = view;
-        }, newConfig);
+        }), newConfig);
 
         // Mark lines so, we can search for them (see e.g. getLineIndex method).
-        this.editorObject.on("renderLine", function(cm, lineHandle, element)
+        this.editorObject.on("renderLine", clone(function(cm, lineHandle, element)
         {
             Css.setClass(element, "firebug-line");
-        });
+        }));
 
         // xxxHonza: 'contextmenu' event provides wrong target (clicked) element.
         // So, handle 'mousedown' first to remember the clicked element, etc. and
         // allow to use it through getContextMenuInfo.
-        var scroller = this.editorObject.display.scroller;
+        var scroller = Wrapper.wrapObject(this.editorObject.display.scroller);
         scroller.addEventListener("mousedown", this.onMouseDown.bind(this));
 
         Trace.sysout("sourceEditor.init; ", this.view);
@@ -292,8 +293,6 @@ SourceEditor.prototype =
     {
         Trace.sysout("sourceEditor.addEventListener; " + type);
 
-        var editorNode;
-
         if (isBuiltInEvent(type))
         {
             var func = function()
@@ -317,12 +316,11 @@ SourceEditor.prototype =
                         return;
                 }
 
-                editorNode = this.editorObject.getWrapperElement();
-                editorNode.addEventListener(type, handler, false);
+                this.getViewElement().addEventListener(type, handler, false);
             }
 
             this.BuiltInEventsHandlers[type].push({ handler: handler, func: func });
-            this.editorObject.on(type, func);
+            this.editorObject.on(type, this.cloneIntoCMScope(func));
         }
         else if (type == SourceEditor.Events.breakpointChange)
         {
@@ -344,10 +342,7 @@ SourceEditor.prototype =
             }
 
             if (supportedEvent)
-            {
-                editorNode = this.editorObject.getWrapperElement();
-                editorNode.addEventListener(type, handler, false);
-            }
+                this.getViewElement().addEventListener(type, handler, false);
         }
     },
 
@@ -400,10 +395,7 @@ SourceEditor.prototype =
             }
 
             if (supportedEvent)
-            {
-                var editorNode = this.editorObject.getWrapperElement();
-                editorNode.removeEventListener(type, handler, false);
-            }
+                this.getViewElement().removeEventListener(type, handler, false);
         }
     },
 
@@ -656,7 +648,7 @@ SourceEditor.prototype =
     {
         var clone = this.cloneIntoCMScope.bind(this);
         var self = this;
-        var contentHintFunction = function(editor)
+        var contentHintFunction = clone(function(editor)
         {
             editor = Wrapper.unwrapObject(editor);
             var ret = hintFunction(self, editor);
@@ -670,7 +662,7 @@ SourceEditor.prototype =
                 from: clone(ret.from),
                 to: clone(ret.to)
             });
-        };
+        });
         this.getCodeMirrorSingleton().showHint(this.editorObject, contentHintFunction);
     },
 
@@ -1107,17 +1099,17 @@ SourceEditor.prototype =
 
     getViewElement: function()
     {
-        return this.editorObject.getWrapperElement();
+        return Wrapper.wrapObject(this.editorObject.getWrapperElement());
     },
 
     getGutterElement: function()
     {
-        return this.editorObject.getGutterElement();
+        return Wrapper.wrapObject(this.editorObject.getGutterElement());
     },
 
     getScrollerElement: function()
     {
-        return this.editorObject.getScrollerElement();
+        return Wrapper.wrapObject(this.editorObject.getScrollerElement());
     },
 
     // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list