summaryrefslogtreecommitdiff
path: root/modules/gallery/js
diff options
context:
space:
mode:
authorshadlaws <shad@shadlaws.com>2013-03-12 10:33:33 +0100
committershadlaws <shad@shadlaws.com>2013-03-12 10:33:33 +0100
commit86a21cc88127ea44d47e708c7093aa236317609d (patch)
tree116a6e8f72fecb822530981044454e843dc758a2 /modules/gallery/js
parentcb8a63bb483742e86af9afd4e931b36638131317 (diff)
#2055, 2056 - jQuery updates for .attr("value", [value]) and .keyup(handler).
- changed .attr("value", [value]) to .val([value]) for new jQuery. - changed .keyup(handler) to .on("input keyup", handler) to fire on mouse-only cut'n'paste.
Diffstat (limited to 'modules/gallery/js')
-rw-r--r--modules/gallery/js/l10n_client.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js
index 6d919c29..261461b9 100644
--- a/modules/gallery/js/l10n_client.js
+++ b/modules/gallery/js/l10n_client.js
@@ -121,11 +121,11 @@ jQuery.extend(Gallery, {
translation[form] = '';
}
$("#plural-" + form + " textarea[name='l10n-edit-plural-translation-" + form + "']")
- .attr('value', translation[form]);
+ .val(translation[form]);
$('#plural-' + form).removeClass('hidden');
}
} else {
- $('#l10n-edit-translation').attr('value', translation);
+ $('#l10n-edit-translation').val(translation);
$('#l10n-edit-translation').removeClass('hidden');
}
};
@@ -167,10 +167,10 @@ jQuery.extend(Gallery, {
text = source['one'];
}
$("#plural-" + form + " textarea[name='l10n-edit-plural-translation-" + form + "']")
- .attr('value', text);
+ .val(text);
}
} else {
- $('#l10n-edit-translation').attr('value', source);
+ $('#l10n-edit-translation').val(source);
}
}
@@ -240,7 +240,7 @@ Gallery.behaviors.l10nClient = function(context) {
});
// Custom listener for l10n_client livesearch
- $('#l10n-client #g-l10n-search').keyup(function(key) {
+ $('#l10n-client #g-l10n-search').on("input keyup", function(key) {
Gallery.l10nClient.filter($('#l10n-client #g-l10n-search').val());
});
@@ -264,11 +264,11 @@ Gallery.behaviors.l10nClient = function(context) {
if (is_plural) {
for (var i = 0; i < num_plural_forms; i++) {
var form = plural_forms[i];
- translation[form] = $("#plural-" + form + " textarea[name='l10n-edit-plural-translation-" + form + "']").attr('value');
+ translation[form] = $("#plural-" + form + " textarea[name='l10n-edit-plural-translation-" + form + "']").val();
is_non_empty = is_non_empty || translation[form];
}
} else {
- translation = $('#l10n-edit-translation').attr('value');
+ translation = $('#l10n-edit-translation').val();
is_non_empty = translation;
}
Gallery.l10nClient.setString(Gallery.l10nClient.selected, translation);