Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

Commit

Permalink
rework js around tree_editor
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Apr 25, 2013
1 parent b78d17f commit 4ae3875
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/ruote-kit/public/_ruote/javascripts/ruote-fluo-all.min.js

Large diffs are not rendered by default.

20 changes: 9 additions & 11 deletions lib/ruote-kit/views/_tree_editor.html.haml
Expand Up @@ -29,32 +29,30 @@
var def = $('#tree')[0].value;
if (def.match(/\s*\[/)) tree = JSON.parse(def);

FluoEditor.render('fluo_editor', tree);
Fluo.render('efluo', tree);
RuoteFluoEditor.render('#fluo_editor', tree);
RuoteFluo.render('#efluo', tree);

$('#fluo_editor')[0].onChange = function (tree) {
Fluo.render('efluo', tree);
$('#fluo_editor')[0].onChange = function(tree) {
RuoteFluo.render('#efluo', tree);
}
$('#fluo_editor')[0].onOver = function (expid) {
Fluo.highlight('efluo', expid);
$('#fluo_editor')[0].onOver = function(expid) {
RuoteFluo.highlight('#efluo', expid);
}
}

function showEditor() {

initEditor();

document.getElementById('overlay').style.height =
'' + window.outerHeight + 'px';

$('#overlay').slideDown(function () { $('#editor').show(); });
$('#overlay').css('height', '' + window.outerHeight + 'px');
$('#overlay').slideDown(function() { $('#editor').show(); });
}

function hideEditor(use) {

$('#editor').hide();
$('#overlay').hide();

if (use) $('#tree')[0].value = FluoEditor.asJson('fluo_editor');
if (use) $('#tree')[0].value = RuoteFluoEditor.asJson('#fluo_editor');
}

0 comments on commit 4ae3875

Please sign in to comment.