summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-06 21:02:22 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-06 21:02:22 -0700
commitd3f46436999b7326e88986daa5a99516430dbf15 (patch)
tree0468833847c6c1b4f4709a2a9d2bd13288967613
parent6e4023a7207b721694403f38d6afb7a507468498 (diff)
* Rename setContents -> show_album to be consistent style wise (no camel
caps) and more explicit about what it's doing. * use toggleClass() to simplify the +/- css management.
-rw-r--r--modules/organize/js/organize.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index 4c45b007..d2006c27 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -16,26 +16,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;