mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-04-18 19:49:19 -04:00
#2013 - Clean up gallery.panel.js.
- prepend "data-" in front of non-standard attr to be more standards compliant.
This commit is contained in:
@@ -10,19 +10,19 @@
|
||||
var parentClass = $(parent).attr("class");
|
||||
var ePanel = "<tr id=\"g-panel\"><td colspan=\"6\"></td></tr>";
|
||||
|
||||
// We keep track of the open vs. closed state by looking to see if there'
|
||||
// an orig_text attr. If that attr is missing, then the panel is closed
|
||||
// We keep track of the open vs. closed state by looking to see if there's
|
||||
// a data-orig-text attr. If that attr is missing, then the panel is closed
|
||||
// and we want to open it
|
||||
var should_open = !$(element).attr("orig_text");
|
||||
var should_open = !$(element).attr("data-orig-text");
|
||||
|
||||
// Close any open panels and reset their button text
|
||||
if ($("#g-panel").length) {
|
||||
$("#g-panel").slideUp("slow").remove();
|
||||
$.each($(".g-panel-link"),
|
||||
function() {
|
||||
if ($(this).attr("orig_text")) {
|
||||
$(this).children(".g-button-text").text($(this).attr("orig_text"));
|
||||
$(this).attr("orig_text", "");
|
||||
if ($(this).attr("data-orig-text")) {
|
||||
$(this).children(".g-button-text").text($(this).attr("data-orig-text"));
|
||||
$(this).attr("data-orig-text", "");
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -45,9 +45,9 @@
|
||||
|
||||
$("#g-panel td").html(content);
|
||||
self._ajaxify_panel();
|
||||
if ($(element).attr("open_text")) {
|
||||
$(element).attr("orig_text", $(element).children(".g-button-text").text());
|
||||
$(element).children(".g-button-text").text($(element).attr("open_text"));
|
||||
if ($(element).attr("data-open-text")) {
|
||||
$(element).attr("data-orig-text", $(element).children(".g-button-text").text());
|
||||
$(element).children(".g-button-text").text($(element).attr("data-open-text"));
|
||||
}
|
||||
$("#g-panel").addClass(parentClass).show().slideDown("slow");
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?= url::site("admin/users/edit_user_form/$user->id") ?>"
|
||||
open_text="<?= t("Close") ?>"
|
||||
data-open-text="<?= t("Close") ?>"
|
||||
class="g-panel-link g-button ui-state-default ui-corner-all ui-icon-left">
|
||||
<span class="ui-icon ui-icon-pencil"></span><span class="g-button-text"><?= t("Edit") ?></span></a>
|
||||
<? if (identity::active_user()->id != $user->id && !$user->guest): ?>
|
||||
|
||||
Reference in New Issue
Block a user