Fixed a bug in the browser template.
This commit is contained in:
parent
e3836b5a41
commit
5268a19a48
@ -46,17 +46,16 @@ ScribeEngine.Namespace.create("ScribeEngine.Media", {
|
|||||||
.append(
|
.append(
|
||||||
$("<a>").attr("href", "#").attr("class", "file")
|
$("<a>").attr("href", "#").attr("class", "file")
|
||||||
.html("<img src=\""+ file.type +"\" />")
|
.html("<img src=\""+ file.type +"\" />")
|
||||||
.click(ScribeEngine.Media.selectFile)
|
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
$("<a>").attr("href", "#").attr("class", "caption")
|
$("<a>").attr("href", "#").attr("class", "caption")
|
||||||
.attr("title", file.name).text(file.name)
|
.attr("title", file.name).text(file.name)
|
||||||
.click(ScribeEngine.Media.selectFile)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
selectFile: function (e)
|
selectFile: function (e)
|
||||||
{
|
{
|
||||||
@ -67,10 +66,12 @@ ScribeEngine.Namespace.create("ScribeEngine.Media", {
|
|||||||
}
|
}
|
||||||
li.parent().children("li").children(".selected").removeClass("selected");
|
li.parent().children("li").children(".selected").removeClass("selected");
|
||||||
li.children("a").addClass("selected").blur();
|
li.children("a").addClass("selected").blur();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ScribeEngine.Events.load(function () {
|
ScribeEngine.Events.load(function () {
|
||||||
ScribeEngine.Events.click("#new-directory", ScribeEngine.Media.newDirectory);
|
ScribeEngine.Events.click("#new-directory", ScribeEngine.Media.newDirectory);
|
||||||
ScribeEngine.Events.click("#file-select", ScribeEngine.Media.closeWindow);
|
ScribeEngine.Events.click("#file-select", ScribeEngine.Media.closeWindow);
|
||||||
|
ScribeEngine.Events.liveClick("#file-list > ul > li > a", ScribeEngine.Media.selectFile);
|
||||||
});
|
});
|
||||||
|
@ -90,6 +90,9 @@ ScribeEngine.Namespace.create("ScribeEngine.Events", {
|
|||||||
keypress: function (selector, func) {
|
keypress: function (selector, func) {
|
||||||
$(selector).bind("keypress", func);
|
$(selector).bind("keypress", func);
|
||||||
},
|
},
|
||||||
|
liveClick: function (selector, func) {
|
||||||
|
$(selector).live("click", func);
|
||||||
|
},
|
||||||
getElement: function(event) {
|
getElement: function(event) {
|
||||||
var targ;
|
var targ;
|
||||||
if (!event) {
|
if (!event) {
|
||||||
|
@ -31,11 +31,11 @@
|
|||||||
<ul>
|
<ul>
|
||||||
% for file in c.files:
|
% for file in c.files:
|
||||||
<li>
|
<li>
|
||||||
<a href="#" class="file"><img src="${file[u'type']}" /></div>
|
<a href="#" class="file"><img src="${file[u'type']}" /></a>
|
||||||
% if len(file[u'name']) > 15:
|
% if len(file[u'name']) > 15:
|
||||||
<a href="#" class="caption" title="${file[u'name']}">${file[u'name'][:12]}...</div>
|
<a href="#" class="caption" title="${file[u'name']}">${file[u'name'][:12]}...</a>
|
||||||
% else:
|
% else:
|
||||||
<a href="#" class="caption">${file[u'name']}</div>
|
<a href="#" class="caption">${file[u'name']}</a>
|
||||||
% endif
|
% endif
|
||||||
</li>
|
</li>
|
||||||
% endfor
|
% endfor
|
||||||
|
Reference in New Issue
Block a user