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 @@