jqr-helpers 1.0.30 → 1.0.31
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/jqr-helpers.js +20 -3
- data/jqr-helpers.gemspec +1 -1
- data/lib/jqr-helpers/version.rb +1 -1
- metadata +1 -1
@@ -327,15 +327,27 @@
|
|
327
327
|
return false;
|
328
328
|
}
|
329
329
|
|
330
|
-
function
|
331
|
-
var radio = $(event.currentTarget).prev('input');
|
330
|
+
function updateQuickButton(radio, label) {
|
332
331
|
var form = radio[0].form;
|
333
332
|
var name = $(radio).attr('name');
|
334
333
|
$(form).find('input[name="' + name + '"]').each(function() {
|
335
334
|
$(this).next('label').removeClass('ui-state-active');
|
336
335
|
});
|
337
336
|
|
338
|
-
|
337
|
+
label.addClass('ui-state-active');
|
338
|
+
|
339
|
+
}
|
340
|
+
|
341
|
+
function ujsQuickButtonChange(event) {
|
342
|
+
var radio = $(event.currentTarget);
|
343
|
+
var label = radio.next('label');
|
344
|
+
updateQuickButton(radio, label);
|
345
|
+
}
|
346
|
+
|
347
|
+
function ujsQuickButtonClick(event) {
|
348
|
+
var label = $(event.currentTarget);
|
349
|
+
var radio = label.prev('input');
|
350
|
+
updateQuickButton(radio, label);
|
339
351
|
}
|
340
352
|
|
341
353
|
function ujsQuickButtonHover(event) {
|
@@ -344,6 +356,8 @@
|
|
344
356
|
|
345
357
|
function ujsLoadPlugins(event) {
|
346
358
|
|
359
|
+
$j('.ujs-quick-buttonset input:checked').change();
|
360
|
+
|
347
361
|
function addHiddenField(form, name, value) {
|
348
362
|
var input = $('<input type="hidden">');
|
349
363
|
input.attr('name', name);
|
@@ -427,6 +441,8 @@
|
|
427
441
|
$(document).on('ajax:success', '.ujs-ajax', ujsAjaxSuccess);
|
428
442
|
$(document).on('ajax:error', '.ujs-ajax', ujsAjaxError);
|
429
443
|
$(document).on('click', '[data-ujs-confirm=true]', ujsConfirmClick);
|
444
|
+
$(document).on('change', '.ujs-quick-buttonset input',
|
445
|
+
ujsQuickButtonChange);
|
430
446
|
$(document).on('click', '.ujs-quick-buttonset label',
|
431
447
|
ujsQuickButtonClick);
|
432
448
|
$(document).on('mouseenter mouseleave', '.ujs-quick-buttonset label',
|
@@ -442,6 +458,7 @@
|
|
442
458
|
$('.ujs-ajax').live('ajax:success', ujsAjaxSuccess);
|
443
459
|
$('.ujs-ajax').live('ajax:error', ujsAjaxError);
|
444
460
|
$('[data-ujs-confirm=true]').live('click', ujsConfirmClick);
|
461
|
+
$('.ujs-quick-buttonset input').live('change', ujsQuickButtonChange);
|
445
462
|
$('.ujs-quick-buttonset label').live('click', ujsQuickButtonClick);
|
446
463
|
$('.ujs-quick-buttonset label').live('mouseenter mouseleave',
|
447
464
|
ujsQuickButtonHover);
|
data/jqr-helpers.gemspec
CHANGED
data/lib/jqr-helpers/version.rb
CHANGED