summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-08-05 15:24:31 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-08-05 15:24:31 -0700
commit824a80b0d4b5c12f5bd6981cac08b406de637dd3 (patch)
treee461bbe84316ff4e6f0666173712eabf96dc06f8 /modules
parenta92a46b0cda18a3ba794a67c07181a2ca405a2a6 (diff)
Change the content pane based on the selection in the album tree
Diffstat (limited to 'modules')
-rw-r--r--modules/organize/js/organize.js26
1 files changed, 22 insertions, 4 deletions
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index 74b02569..194a2a19 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -64,12 +64,10 @@
});
$(".gBranchText span").click(_collapse_or_expanded_tree);
+ $(".gBranchText").click(_setContents);
//$(".gOrganizeBranch .ui-icon").click(organizeToggleChildren);
//$(".gBranchText").droppable(treeDroppable);
- //$(".gBranchText").click(organizeOpenFolder);
- //retrieveMicroThumbs(item_id);
- //showLoading("#gOrganizeDialog");
//$("#gMicroThumbPanel").droppable(thumbDroppable);
//$("#gMicroThumbPanel").selectable(selectable);
@@ -114,6 +112,7 @@
* Open or close a branch. If the children is a div placeholder, replace with <ul>
*/
function _collapse_or_expanded_tree(event) {
+ event.stopPropagation();
var id = $(event.currentTarget).attr("ref");
if ($(event.currentTarget).hasClass("ui-icon-minus")) {
$(event.currentTarget).removeClass("ui-icon-minus");
@@ -127,7 +126,8 @@
$.get(url, function(data) {
$("#gOrganizeChildren-" + id).html(data);
$(".gBranchText span").click(_collapse_or_expanded_tree);
- });;
+ $(".gBranchText").click(_setContents);
+ });
}
$("#gOrganizeChildren-" + id).show();
$(event.currentTarget).removeClass("ui-icon-plus");
@@ -135,6 +135,24 @@
}
}
+ /**
+ * When the text of a selection is clicked, then show that albums contents
+ */
+ function _setContents(event) {
+ event.preventDefault();
+ if ($(event.currentTarget).hasClass("gBranchSelected")) {
+ return;
+ }
+ var id = $(event.currentTarget).attr("ref");
+ $(".gBranchSelected").removeClass("gBranchSelected");
+ $(event.currentTarget).addClass("gBranchSelected");
+ var url = $("#gMicroThumbPanel").attr("ref").replace("__ITEM_ID__", id).replace("__OFFSET__", 0);
+ $.get(url, function(data) {
+ $("#gMicroThumbGrid").html(data);
+ });
+
+ }
+
})(jQuery);
$("document").ready(function() {