Precompiled assets
This commit is contained in:
parent
8101f07566
commit
fc498626d4
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1,42 @@
|
|||||||
|
(function() {
|
||||||
|
var visit;
|
||||||
|
|
||||||
|
$(document).on('turbolinks:load', function() {
|
||||||
|
$('table.list td.view a').each(function() {
|
||||||
|
return visit($(this));
|
||||||
|
});
|
||||||
|
return $('.pagination .next a').attr('data-remote', true).each(function() {
|
||||||
|
return $(document).scroll((function(_this) {
|
||||||
|
return function() {
|
||||||
|
if ($(_this).visible(true, true)) {
|
||||||
|
return $(_this).click().parents('.pagination').hide();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('ajax:success', '.pagination .next a', function(event, data) {
|
||||||
|
var next;
|
||||||
|
$(this).parents('tfoot').prev().append($('tbody tr', data)).find('td.view a').each(function() {
|
||||||
|
return visit($(this));
|
||||||
|
});
|
||||||
|
next = $('.pagination .next a', data).attr('href');
|
||||||
|
if (next != null) {
|
||||||
|
return $(this).attr('href', next).parents('.pagination').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
visit = (function(_this) {
|
||||||
|
return function(elt) {
|
||||||
|
return elt.closest('tr').addClass('view').click(function(event) {
|
||||||
|
var target;
|
||||||
|
target = $(event.target);
|
||||||
|
if (!((target.attr('target') != null) || (target.parents('a').attr('target') != null))) {
|
||||||
|
return Turbolinks.visit(elt.attr('href'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
})(this);
|
||||||
|
|
||||||
|
}).call(this);
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user