Sha256: f7aad425825fb4a0c1d49eaade0c7cddf6e03ad2e1f4e212192e802da330b771
Contents?: true
Size: 453 Bytes
Versions: 62
Compression:
Stored size: 453 Bytes
Contents
/** * Add data-replace to an element. When that element is also data-remote, the * element will be replaced by the server's response (with WORKAREA modules * initialized). */ $(document).on('ajax:success', function (event, response) { var $target = $(event.target); if ($target.is('[data-replace]')) { var $replacement = $(response); WORKAREA.initModules($replacement); $target.replaceWith($replacement); } });
Version data entries
62 entries across 62 versions & 1 rubygems