summaryrefslogtreecommitdiff
path: root/modules/organize/js/organize.js
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-08-06 22:15:17 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-08-06 22:15:17 -0700
commit36a46de19099ee9c4eeb7b58b14862a9f3b8a4f2 (patch)
treef0fdcf2acc72c1eb1af4e15452f808ffd466005c /modules/organize/js/organize.js
parent99c57b2036c6fbef757762a7faccc27150471892 (diff)
parenta245c57400398d2b4b1c2aea94f590a9c0a7d8a8 (diff)
Merge branch 'master' of git@github.com:talmdal/gallery3
Diffstat (limited to 'modules/organize/js/organize.js')
-rw-r--r--modules/organize/js/organize.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index 4c45b007..6b4a5934 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -4,6 +4,12 @@
* Dynamically initialize the organize dialog when it is displayed
*/
init: function(data) {
+ // Resize with 50 pixels padding all around
+ var size = $.getViewportSize();
+ $("#gDialog").dialog("option", "height", size.height() - 100)
+ .dialog("option", "width", size.width() - 100)
+ .dialog("option", "position", "center");
+
// Deal with ui.jquery bug: http://dev.jqueryui.com/ticket/4475 (target 1.8?)
$(".sf-menu li.sfHover ul").css("z-index", 70);
@@ -16,26 +22,22 @@
});
$(".gBranchText span").click($.organize.collapse_or_expand_tree);
- $(".gBranchText").click($.organize.setContents);
+ $(".gBranchText").click($.organize.show_album);
},
/**
- * Open or close a branch. If the children is a div placeholder, replace with <ul>
+ * Open or close a branch.
*/
- collapse_or_expand_tree: function (event) {
+ collapse_or_expand_tree: function(event) {
event.stopPropagation();
- if ($(event.currentTarget).hasClass("ui-icon-minus")) {
- $(event.currentTarget).removeClass("ui-icon-minus").addClass("ui-icon-plus");
- } else {
- $(event.currentTarget).removeClass("ui-icon-plus").addClass("ui-icon-minus");
- }
+ $(event.currentTarget).toggleClass("ui-icon-minus").toggleClass("ui-icon-plus");
$("#gOrganizeChildren-" + $(event.currentTarget).attr("ref")).toggle();
},
/**
* When the text of a selection is clicked, then show that albums contents
*/
- setContents: function(event) {
+ show_album: function(event) {
event.preventDefault();
if ($(event.currentTarget).hasClass("gBranchSelected")) {
return;