From 5268a19a482482dd1e611daf74e17a22289b7830 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 6 Jun 2010 22:10:03 +0200 Subject: [PATCH] Fixed a bug in the browser template. --- scribeengine/public/scripts/ScribeEngine.Media.js | 5 +++-- scribeengine/public/scripts/ScribeEngine.js | 3 +++ scribeengine/templates/media/index.mako | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scribeengine/public/scripts/ScribeEngine.Media.js b/scribeengine/public/scripts/ScribeEngine.Media.js index fb6f60c..2a77354 100644 --- a/scribeengine/public/scripts/ScribeEngine.Media.js +++ b/scribeengine/public/scripts/ScribeEngine.Media.js @@ -46,17 +46,16 @@ ScribeEngine.Namespace.create("ScribeEngine.Media", { .append( $("").attr("href", "#").attr("class", "file") .html("") - .click(ScribeEngine.Media.selectFile) ) .append( $("").attr("href", "#").attr("class", "caption") .attr("title", file.name).text(file.name) - .click(ScribeEngine.Media.selectFile) ) ); }); } ); + return false; }, selectFile: function (e) { @@ -67,10 +66,12 @@ ScribeEngine.Namespace.create("ScribeEngine.Media", { } li.parent().children("li").children(".selected").removeClass("selected"); li.children("a").addClass("selected").blur(); + return false; } }); ScribeEngine.Events.load(function () { ScribeEngine.Events.click("#new-directory", ScribeEngine.Media.newDirectory); ScribeEngine.Events.click("#file-select", ScribeEngine.Media.closeWindow); + ScribeEngine.Events.liveClick("#file-list > ul > li > a", ScribeEngine.Media.selectFile); }); diff --git a/scribeengine/public/scripts/ScribeEngine.js b/scribeengine/public/scripts/ScribeEngine.js index 33f4967..955ab21 100644 --- a/scribeengine/public/scripts/ScribeEngine.js +++ b/scribeengine/public/scripts/ScribeEngine.js @@ -90,6 +90,9 @@ ScribeEngine.Namespace.create("ScribeEngine.Events", { keypress: function (selector, func) { $(selector).bind("keypress", func); }, + liveClick: function (selector, func) { + $(selector).live("click", func); + }, getElement: function(event) { var targ; if (!event) { diff --git a/scribeengine/templates/media/index.mako b/scribeengine/templates/media/index.mako index 6743731..a0beb7f 100644 --- a/scribeengine/templates/media/index.mako +++ b/scribeengine/templates/media/index.mako @@ -31,11 +31,11 @@