summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-05-13 22:56:51 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-05-13 22:56:51 +0000
commitdaebdab0c6a96b8fabc12b5bbbb438a134e4226d (patch)
treed62c19610aa0dbeef6f9d2f1e8fdaa28d264d88d
parentbaa220186e176191e34383b5871746cefe6e5c8e (diff)
Address the final point in #226. Disable the make album cover icon if
the pane has the ui-state-disabled class
-rw-r--r--core/js/quick.js3
-rw-r--r--core/views/quick_pane.html.php6
2 files changed, 8 insertions, 1 deletions
diff --git a/core/js/quick.js b/core/js/quick.js
index 984d3ae5..750bdd40 100644
--- a/core/js/quick.js
+++ b/core/js/quick.js
@@ -50,6 +50,9 @@ var show_quick = function() {
};
var quick_do = function(cont, pane, img) {
+ if (pane.hasClass("ui-state-disabled")) {
+ return false;
+ }
if (pane.hasClass("gDialogLink")) {
openDialog(pane, function() { window.location.reload(); });
} else {
diff --git a/core/views/quick_pane.html.php b/core/views/quick_pane.html.php
index 7d4b6959..0f94a413 100644
--- a/core/views/quick_pane.html.php
+++ b/core/views/quick_pane.html.php
@@ -46,15 +46,19 @@
</a>
<? endif ?>
+<? $disabledState = "" ?>
<? if (access::can("edit", $item->parent())): ?>
<? if ($item->type == "photo"): ?>
<? $title = t("Choose this photo as the album cover") ?>
<? elseif ($item->type == "movie"): ?>
<? $title = t("Choose this movie as the album cover") ?>
<? elseif ($item->type == "album"): ?>
+<? if (empty($item->album_cover_item_id)): ?>
+<? $disabledState = empty($item->album_cover_item_id) ? " ui-state-disabled" : "" ?>
+<? endif ?>
<? $title = t("Choose this album as the album cover") ?>
<? endif ?>
-<a class="gButtonLink ui-corner-all ui-state-default" href="<?= url::site("quick/make_album_cover/$item->id?csrf=$csrf&page_type=$page_type") ?>"
+<a class="gButtonLink ui-corner-all ui-state-default<?= $disabledState ?>" href="<?= url::site("quick/make_album_cover/$item->id?csrf=$csrf&page_type=$page_type") ?>"
title="<?= $title ?>">
<span class="ui-icon ui-icon-star">
<?= $title ?>