summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-11-23 13:15:16 +0000
committerhallgren <hallgren@chalmers.se>2012-11-23 13:15:16 +0000
commit9e430184ba5063110e5ec72c6137e4d38f92e206 (patch)
tree910d4f786d56766e2a0efda6d75b535d47654e46 /src
parentee2f0a748737dc6e4a1723a9c73e91b73621a645 (diff)
syntax editor + minibar: fix bug with repeated switching back and forth
By avoiding "this" in callback functions, the code can be kept cleaner.
Diffstat (limited to 'src')
-rw-r--r--src/www/minibar/minibar.js1
-rw-r--r--src/www/minibar/minibar_translations.js3
-rw-r--r--src/www/syntax-editor/editor_online.js9
3 files changed, 6 insertions, 7 deletions
diff --git a/src/www/minibar/minibar.js b/src/www/minibar/minibar.js
index 9d87842e9..258de3078 100644
--- a/src/www/minibar/minibar.js
+++ b/src/www/minibar/minibar.js
@@ -41,7 +41,6 @@ function Minibar(server,opts) {
/* --- Creating the components of the minibar --------------------------- */
this.translations=new Translations(server,this.options)
- this.translations.minibar=this; // ref to parent
this.input=new Input(server,this.translations,this.options)
/* --- Creating user interface elements --------------------------------- */
diff --git a/src/www/minibar/minibar_translations.js b/src/www/minibar/minibar_translations.js
index 6f08ddf5c..db0382d34 100644
--- a/src/www/minibar/minibar_translations.js
+++ b/src/www/minibar/minibar_translations.js
@@ -103,8 +103,7 @@ Translations.prototype.show_translations=function(translationResults) {
var tbody=empty("tbody");
if(options.show_abstract && t.tree) {
function abs_act() {
- var minibar = self.minibar;
- bind(self.options.abstract_action,minibar)(t.tree)
+ self.options.abstract_action(t.tree)
}
var abs_hdr = options.abstract_action
? button("Abstract",abs_act)
diff --git a/src/www/syntax-editor/editor_online.js b/src/www/syntax-editor/editor_online.js
index 9edcf2947..a519d28ce 100644
--- a/src/www/syntax-editor/editor_online.js
+++ b/src/www/syntax-editor/editor_online.js
@@ -35,7 +35,7 @@ if(window.Minibar) // Minibar loaded?
},
// get us back to the editor!
abstract_action: function(tree) {
- var minibar=this;
+ //var minibar=this;
// how to get hold of new minibar?
var editor_options = {
target: "editor",
@@ -45,13 +45,14 @@ if(window.Minibar) // Minibar loaded?
abstr: tree
}
}
- minibar.hide();
- minibar.editor.show();
+ editor.minibar.hide();
+ editor.show();
}
}
editor.hide();
editor.minibar=new Minibar(server,minibar_options);
- editor.minibar.editor = editor; // :S
+ //editor.minibar.editor = editor; // :S
+ editor.minibar.show()
}
if(/^\?\/tmp\//.test(location.search)) {
var args=decodeURIComponent(location.search.substr(1)).split(" ")