Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Replace existing modal callback with new callback. #743

Merged
merged 1 commit into from
Sep 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions static/js/modules/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ function modalRenderRow(row, data, index) {
}

function modalRenderFactory(template, fetch) {
var callback;
fetch = fetch || identity;
return function(api, data, response) {
var $table = $(api.table().node());
Expand All @@ -275,7 +276,8 @@ function modalRenderFactory(template, fetch) {
$modal.appendTo($main);
$table.find('tr').attr('tabindex', 0);

$table.on('click keypress', '.js-panel-toggle tr.' + MODAL_TRIGGER_CLASS, function(e) {
$table.off('click keypress', '.js-panel-toggle tr.' + MODAL_TRIGGER_CLASS, callback);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.

callback = function(e) {
if (e.which === 13 || e.type === 'click') {
// Note: Use `currentTarget` to get parent row, since the target column
// may have been moved since the triggering event
Expand Down Expand Up @@ -313,7 +315,8 @@ function modalRenderFactory(template, fetch) {
});
}
}
});
};
$table.on('click keypress', '.js-panel-toggle tr.' + MODAL_TRIGGER_CLASS, callback);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long.


$modal.on('click', '.js-panel-close', function(e) {
e.preventDefault();
Expand Down