Skip to content
Snippets Groups Projects
Commit 79c112f6 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix js errors, fixes #968

Closes #968

Merge request !558
parent 33d05907
No related branches found
No related tags found
No related merge requests found
Showing
with 98 additions and 130 deletions
/*jslint esversion: 6 */
(function ($) { (function ($) {
'use strict'; 'use strict';
......
import { $gettext } from '../lib/gettext.js'; import { $gettext } from '../lib/gettext.js';
/*jslint browser: true, esversion: 6 */
/*global window, $, jQuery, _ */
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
* application.js * application.js
* This file is part of Stud.IP - http://www.studip.de * This file is part of Stud.IP - http://www.studip.de
...@@ -331,7 +329,7 @@ STUDIP.domReady(function () { ...@@ -331,7 +329,7 @@ STUDIP.domReady(function () {
} else { } else {
STUDIP.Scroll.removeHandler('horizontal-scroll'); STUDIP.Scroll.removeHandler('horizontal-scroll');
} }
}; }
if ($('.no-touch #layout_content').length > 0) { if ($('.no-touch #layout_content').length > 0) {
window.matchMedia('screen').addListener(function() { window.matchMedia('screen').addListener(function() {
...@@ -348,7 +346,7 @@ jQuery(document).on('click', '.course-admin td .course-completion', function () ...@@ -348,7 +346,7 @@ jQuery(document).on('click', '.course-admin td .course-completion', function ()
var href = $(this).attr('href'), var href = $(this).attr('href'),
timeout = window.setTimeout(function () { timeout = window.setTimeout(function () {
$(this).addClass('ajaxing'); $(this).addClass('ajaxing');
}.bind(this), 300);; }.bind(this), 300);
$.getJSON(href).done(function (completion) { $.getJSON(href).done(function (completion) {
clearTimeout(timeout); clearTimeout(timeout);
......
/*jslint browser: true */
/*global jQuery, STUDIP */
(function ($, STUDIP) { (function ($, STUDIP) {
'use strict'; 'use strict';
......
/*global jQuery, STUDIP */
STUDIP.domReady(() => { STUDIP.domReady(() => {
STUDIP.Avatar.init('#avatar-upload'); STUDIP.Avatar.init('#avatar-upload');
......
/*global jQuery, STUDIP */
STUDIP.domReady(() => { STUDIP.domReady(() => {
STUDIP.Blubber.init(); STUDIP.Blubber.init();
}); });
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* @since Stud.IP 5.0 * @since Stud.IP 5.0
*/ */
/*global jQuery, STUDIP */
import CacheAdministration from '../../../vue/components/CacheAdministration.vue' import CacheAdministration from '../../../vue/components/CacheAdministration.vue'
STUDIP.domReady(() => { STUDIP.domReady(() => {
......
import { $gettext } from '../lib/gettext.js'; import { $gettext } from '../lib/gettext.js';
/*jslint esversion: 6*/
$(document).on('click', 'a.copyable-link', function (event) { $(document).on('click', 'a.copyable-link', function (event) {
event.preventDefault(); event.preventDefault();
......
/*jslint esversion: 6 */
function searchMoreFiles (button) { function searchMoreFiles (button) {
var table = $(button).closest('table'); var table = $(button).closest('table');
var loading = $('<div class="loading" style="padding: 10px">').html( var loading = $('<div class="loading" style="padding: 10px">').html(
...@@ -76,7 +75,7 @@ jQuery(document).on('ajaxComplete', (event, xhr) => { ...@@ -76,7 +75,7 @@ jQuery(document).on('ajaxComplete', (event, xhr) => {
var payload = false; var payload = false;
function process(key, handler) { function process(key, handler) {
if (!changes.hasOwnProperty(key)) { if (changes[key] === undefined) {
return; return;
} }
...@@ -86,10 +85,11 @@ jQuery(document).on('ajaxComplete', (event, xhr) => { ...@@ -86,10 +85,11 @@ jQuery(document).on('ajaxComplete', (event, xhr) => {
if (payload === false) { if (payload === false) {
payload = JSON.parse(xhr.responseText); payload = JSON.parse(xhr.responseText);
} }
if (payload.hasOwnProperty(key)) { if (payload[key] !== undefined) {
values = payload[key]; values = payload[key];
} }
} catch (e) { } catch (e) {
console.log('Error parsing payload', e);
} }
} }
......
...@@ -263,19 +263,7 @@ STUDIP.ready(function () { ...@@ -263,19 +263,7 @@ STUDIP.ready(function () {
// class and attribute changes in order to detect when the select // class and attribute changes in order to detect when the select
// element itself will become visible. Pretty straight forward, huh? // element itself will become visible. Pretty straight forward, huh?
$('select.nested-select:not(:has(optgroup)):hidden:not(.select2-awaiting)').each(function() { $('select.nested-select:not(:has(optgroup)):hidden:not(.select2-awaiting)').each(function() {
var observer = new window.MutationObserver(function(mutations) { var observer = new window.MutationObserver(onDomChange);
mutations.forEach(function(mutation) {
if ($('select.select2-awaiting', mutation.target).length > 0) {
$('select.select2-awaiting', mutation.target)
.removeClass('select2-awaiting')
.each(function() {
createSelect2(this);
});
observer.disconnect();
observer = null;
}
});
});
observer.observe($(this).closest(':visible')[0], { observer.observe($(this).closest(':visible')[0], {
attributeOldValue: true, attributeOldValue: true,
attributes: true, attributes: true,
...@@ -288,6 +276,19 @@ STUDIP.ready(function () { ...@@ -288,6 +276,19 @@ STUDIP.ready(function () {
$(this).addClass('select2-awaiting'); $(this).addClass('select2-awaiting');
}); });
function onDomChange(mutations, observer) {
mutations.forEach(function(mutation) {
if ($('select.select2-awaiting', mutation.target).length > 0) {
$('select.select2-awaiting', mutation.target)
.removeClass('select2-awaiting')
.each(function() {
createSelect2(this);
});
observer.disconnect();
}
});
}
// Unfortunately, this code needs to be duplicated because jQuery // Unfortunately, this code needs to be duplicated because jQuery
// namespacing kind of sucks. If the below change handler is namespaced // namespacing kind of sucks. If the below change handler is namespaced
// and we trigger that namespaced event here, still all change handlers // and we trigger that namespaced event here, still all change handlers
......
/*jslint esversion: 6*/
STUDIP.ready(function () { STUDIP.ready(function () {
//Check if fullcalendar instances are to be displayed: //Check if fullcalendar instances are to be displayed:
$('*[data-fullcalendar="1"]').each(function () { $('*[data-fullcalendar="1"]').each(function () {
...@@ -11,18 +10,19 @@ STUDIP.ready(function () { ...@@ -11,18 +10,19 @@ STUDIP.ready(function () {
calendar = STUDIP.Fullcalendar.createFromNode(this); calendar = STUDIP.Fullcalendar.createFromNode(this);
} }
let continuousRefresh = (ttl) => { continuousRefresh(calendar, 10);
}
});
});
function continuousRefresh(calendar, ttl) {
setTimeout(() => { setTimeout(() => {
calendar.updateSize(); calendar.updateSize();
if (ttl > 0) { if (ttl > 0) {
continuousRefresh(ttl - 1); continuousRefresh(ttl - 1);
} }
}, 200); }, 200);
};
continuousRefresh(10);
} }
});
});
if ($('#event-color-picker > option').length <= 1) { if ($('#event-color-picker > option').length <= 1) {
var selectedColor = $('#selected-color').val(); var selectedColor = $('#selected-color').val();
......
...@@ -4,7 +4,7 @@ jQuery( ...@@ -4,7 +4,7 @@ jQuery(
jQuery(document).ready( jQuery(document).ready(
function() { function() {
var elements = jQuery('[data-inline-editing]'); var elements = jQuery('[data-inline-editing]');
for (element of elements) { for (const element of elements) {
STUDIP.InlineEditing.init(element); STUDIP.InlineEditing.init(element);
} }
} }
...@@ -15,7 +15,7 @@ jQuery( ...@@ -15,7 +15,7 @@ jQuery(
null, null,
function() { function() {
var elements = jQuery('.ui-dialog [data-inline-editing]'); var elements = jQuery('.ui-dialog [data-inline-editing]');
for (element of elements) { for (const element of elements) {
STUDIP.InlineEditing.init(element); STUDIP.InlineEditing.init(element);
} }
} }
......
/*jslint esversion: 6*/
function domReady(fn) { function domReady(fn) {
if (document.readyState === 'complete' || document.readyState === 'interactive') { if (document.readyState === 'complete' || document.readyState === 'interactive') {
setTimeout(fn, 1); setTimeout(fn, 1);
......
...@@ -14,6 +14,8 @@ STUDIP.domReady(() => { ...@@ -14,6 +14,8 @@ STUDIP.domReady(() => {
}); });
if (mvv_field != '') { if (mvv_field != '') {
var mvv_id;
var senddata;
$(this) $(this)
.parentsUntil('div') .parentsUntil('div')
.each(function() { .each(function() {
...@@ -31,9 +33,9 @@ STUDIP.domReady(() => { ...@@ -31,9 +33,9 @@ STUDIP.domReady(() => {
var obj_elements = fields[i].split('.'); var obj_elements = fields[i].split('.');
if (obj_elements.length == 1) { if (obj_elements.length == 1) {
var senddata = { mvv_field: fields[i], mvv_debug: mvv_debug, log_action: 'del' }; senddata = { mvv_field: fields[i], mvv_debug: mvv_debug, log_action: 'del' };
} else { } else {
var senddata = { mvv_field: fields[i], mvv_id: mvv_id, log_action: 'update' }; senddata = { mvv_field: fields[i], mvv_id: mvv_id, log_action: 'update' };
} }
var url = STUDIP.URLHelper.getURL('dispatch.php/shared/log_event/get_log_autor'); var url = STUDIP.URLHelper.getURL('dispatch.php/shared/log_event/get_log_autor');
...@@ -57,16 +59,17 @@ STUDIP.domReady(() => { ...@@ -57,16 +59,17 @@ STUDIP.domReady(() => {
var mvv_field = ''; var mvv_field = '';
var mvv_coid = ''; var mvv_coid = '';
var mvv_id = ''; var mvv_id = '';
var mvv_log_action;
switch ($('ins').attr('class')) { switch ($('ins').attr('class')) {
case 'diffins': case 'diffins':
var mvv_log_action = 'new'; mvv_log_action = 'new';
break; break;
case 'diffmod': case 'diffmod':
var mvv_log_action = 'update'; mvv_log_action = 'update';
break; break;
default: default:
var mvv_log_action = null; mvv_log_action = null;
break; break;
} }
...@@ -93,9 +96,10 @@ STUDIP.domReady(() => { ...@@ -93,9 +96,10 @@ STUDIP.domReady(() => {
var ins = $(this); var ins = $(this);
var fields = mvv_field.split(' '); var fields = mvv_field.split(' ');
for (var i = 0; i < fields.length; ++i) { for (var i = 0; i < fields.length; ++i) {
var senddata;
var obj_elements = fields[i].split('.'); var obj_elements = fields[i].split('.');
if (obj_elements.length == 1 && mvv_coid) { if (obj_elements.length == 1 && mvv_coid) {
var senddata = { senddata = {
mvv_field: fields[i], mvv_field: fields[i],
mvv_id: mvv_id, mvv_id: mvv_id,
mvv_coid: mvv_coid, mvv_coid: mvv_coid,
...@@ -113,7 +117,7 @@ STUDIP.domReady(() => { ...@@ -113,7 +117,7 @@ STUDIP.domReady(() => {
.attr('data-mvv-index') + .attr('data-mvv-index') +
';' + ';' +
classes[1]; classes[1];
var senddata = { senddata = {
mvv_field: fields[i], mvv_field: fields[i],
mvv_id: mvv_id, mvv_id: mvv_id,
mvv_coid: mvv_coid, mvv_coid: mvv_coid,
...@@ -124,7 +128,7 @@ STUDIP.domReady(() => { ...@@ -124,7 +128,7 @@ STUDIP.domReady(() => {
return true; return true;
} }
} else { } else {
var senddata = { mvv_field: fields[i], mvv_id: mvv_id, log_action: mvv_log_action }; senddata = { mvv_field: fields[i], mvv_id: mvv_id, log_action: mvv_log_action };
} }
var url = STUDIP.URLHelper.getURL('dispatch.php/shared/log_event/get_log_autor'); var url = STUDIP.URLHelper.getURL('dispatch.php/shared/log_event/get_log_autor');
...@@ -160,7 +164,10 @@ STUDIP.domReady(() => { ...@@ -160,7 +164,10 @@ STUDIP.domReady(() => {
$.post( $.post(
url, url,
{ mvv_field: 'mvv_' + mvv_type, mvv_id: mvv_id, log_action: 'new' }, { mvv_field: 'mvv_' + mvv_type, mvv_id: mvv_id, log_action: 'new' },
function(data) { onSuccess,
'json'
);
function onSuccess((data) {
if (data) { if (data) {
var info = $gettextInterpolate('Hinzugefügt von %{user} am %{time}', data); var info = $gettextInterpolate('Hinzugefügt von %{user} am %{time}', data);
curtable.attr('title', info); curtable.attr('title', info);
...@@ -169,9 +176,7 @@ STUDIP.domReady(() => { ...@@ -169,9 +176,7 @@ STUDIP.domReady(() => {
const row = $('<tr/>').append(cell); const row = $('<tr/>').append(cell);
curtable.append(row); curtable.append(row);
} }
}, };
'json'
);
}); });
}); });
...@@ -191,7 +196,10 @@ STUDIP.domReady(() => { ...@@ -191,7 +196,10 @@ STUDIP.domReady(() => {
$.post( $.post(
url, url,
{ mvv_field: 'mvv_' + mvv_type, mvv_id: mvv_id, log_action: 'del' }, { mvv_field: 'mvv_' + mvv_type, mvv_id: mvv_id, log_action: 'del' },
function(data) { onSuccess,
'json'
);
function onSuccess(data) {
if (data) { if (data) {
var info = $gettextInterpolate('Entfernt von %{user} am %{time}', data); var info = $gettextInterpolate('Entfernt von %{user} am %{time}', data);
curtable.attr('title', info); curtable.attr('title', info);
...@@ -200,9 +208,7 @@ STUDIP.domReady(() => { ...@@ -200,9 +208,7 @@ STUDIP.domReady(() => {
const row = $('<tr/>').append(cell); const row = $('<tr/>').append(cell);
curtable.append(row); curtable.append(row);
} }
}, }
'json'
);
}); });
}); });
}); });
...@@ -47,27 +47,23 @@ $(document).on('click', '.bookable_rooms_action', function(event) { ...@@ -47,27 +47,23 @@ $(document).on('click', '.bookable_rooms_action', function(event) {
.append(me.data('options').clone(true)); .append(me.data('options').clone(true));
} }
if ( let singleDate;
$(this) if ($(this).parents('form').attr('action').split('saveDate/').length > 1) {
.parents('form') singleDate = $(this)
.attr('action')
.split('saveDate/').length > 1
) {
var singleDate = $(this)
.parents('form') .parents('form')
.attr('action') .attr('action')
.split('saveDate/')[1] .split('saveDate/')[1]
.split('?')[0]; .split('?')[0];
} else {
var singleDate = undefined;
} }
let checked_dates;
if ($("input[name='checked_dates']").length > 0) { if ($("input[name='checked_dates']").length > 0) {
var checked_dates = $("input[name='checked_dates']") checked_dates = $("input[name='checked_dates']")
.val() .val()
.split(','); .split(',');
var ndate = []; var ndate = [];
} else { } else {
var checked_dates = [singleDate]; checked_dates = [singleDate];
var startDate = $("input[name='date']").val(); var startDate = $("input[name='date']").val();
var start_time = $("input[name='start_time']") var start_time = $("input[name='start_time']")
.val() .val()
......
...@@ -86,8 +86,7 @@ STUDIP.ready(function () { ...@@ -86,8 +86,7 @@ STUDIP.ready(function () {
//Check if the seats checkbox is checked. Only include "its" input //Check if the seats checkbox is checked. Only include "its" input
//fields when it is checked. //fields when it is checked.
let seats_checked = jQuery(this).find('input[name="special__seats_enabled"]').is(':checked'); let seats_checked = jQuery(this).find('input[name="special__seats_enabled"]').is(':checked');
if (seats_checked) { if (!seats_checked) {
} else {
jQuery(this).find('input[name="special__seats_min"]').attr('disabled', 'disabled'); jQuery(this).find('input[name="special__seats_min"]').attr('disabled', 'disabled');
jQuery(this).find('input[name="special__seats_max"]').attr('disabled', 'disabled'); jQuery(this).find('input[name="special__seats_max"]').attr('disabled', 'disabled');
} }
...@@ -647,19 +646,13 @@ STUDIP.ready(function () { ...@@ -647,19 +646,13 @@ STUDIP.ready(function () {
if (!changed) { if (!changed) {
sURLVariables.push('defaultView=' + defaultView); sURLVariables.push('defaultView=' + defaultView);
} }
if (sURLVariables.length > 2) {
var newurl = sURLVariables[0] + '?' + sURLVariables[1] + '&'; let newurl = `${sURLVariables[0]}?${sURLVariables.slice(1).join('&')}`;
sURLVariables.shift();
sURLVariables.shift();
newurl += sURLVariables.join('&');
} else {
var newurl = sURLVariables.join('?');
}
history.pushState({}, null, newurl); history.pushState({}, null, newurl);
var std_day = newurl.replace(/&?allday=\d+/, ''); var std_day = newurl.replace(/&?allday=\d+/, '');
$('.booking-plan-std_view').attr('href', std_day); $('.booking-plan-std_view').attr('href', std_day);
$('.booking-plan-allday_view').attr('href', std_day + '&allday=1'); $('.booking-plan-allday_view').attr('href', std_day + '&allday=1');
}; }
function submitDatePicker() { function submitDatePicker() {
var picked = $('#booking-plan-jmpdate').val(); var picked = $('#booking-plan-jmpdate').val();
...@@ -727,14 +720,7 @@ STUDIP.ready(function () { ...@@ -727,14 +720,7 @@ STUDIP.ready(function () {
if (!changed) { if (!changed) {
sURLVariables.push('defaultDate=' + changeddate); sURLVariables.push('defaultDate=' + changeddate);
} }
if (sURLVariables.length > 2) { let newurl = `${sURLVariables[0]}?${sURLVariables.slice(1).join('&')}`;
var newurl = sURLVariables[0] + '?' + sURLVariables[1] + '&';
sURLVariables.shift();
sURLVariables.shift();
newurl += sURLVariables.join('&');
} else {
var newurl = sURLVariables.join('?');
}
history.pushState({}, null, newurl); history.pushState({}, null, newurl);
var std_day = newurl.replace(/&?allday=\d+/, ''); var std_day = newurl.replace(/&?allday=\d+/, '');
$('.booking-plan-std_view').attr('href', std_day); $('.booking-plan-std_view').attr('href', std_day);
...@@ -743,7 +729,7 @@ STUDIP.ready(function () { ...@@ -743,7 +729,7 @@ STUDIP.ready(function () {
//Store the date in the sessionStorage: //Store the date in the sessionStorage:
sessionStorage.setItem('booking_plan_date', changeddate) sessionStorage.setItem('booking_plan_date', changeddate)
} }
}; }
jQuery('#booking-plan-jmpdate').datepicker( jQuery('#booking-plan-jmpdate').datepicker(
{ {
...@@ -757,8 +743,7 @@ STUDIP.ready(function () { ...@@ -757,8 +743,7 @@ STUDIP.ready(function () {
} }
); );
var nodes = jQuery('*.resource-plan[data-resources-fullcalendar="1"]'); jQuery('*.resource-plan[data-resources-fullcalendar="1"]').each(function () {
jQuery.each(nodes, function (index, node) {
STUDIP.loadChunk('fullcalendar').then(() => { STUDIP.loadChunk('fullcalendar').then(() => {
//Get the default date from the sessionStorage, if it is set //Get the default date from the sessionStorage, if it is set
//and no date is specified in the url. //and no date is specified in the url.
...@@ -770,10 +755,10 @@ STUDIP.ready(function () { ...@@ -770,10 +755,10 @@ STUDIP.ready(function () {
use_session_date = false; use_session_date = false;
} }
} }
if (node.calendar == undefined) { if (this.calendar === undefined) {
if (jQuery(node).hasClass('semester-plan')) { if (jQuery(this).hasClass('semester-plan')) {
STUDIP.Fullcalendar.createSemesterCalendarFromNode( STUDIP.Fullcalendar.createSemesterCalendarFromNode(
node, this,
{ {
loading: function (isLoading) { loading: function (isLoading) {
if (!isLoading) { if (!isLoading) {
...@@ -810,24 +795,20 @@ STUDIP.ready(function () { ...@@ -810,24 +795,20 @@ STUDIP.ready(function () {
config.defaultDate = session_date_string; config.defaultDate = session_date_string;
} }
} }
STUDIP.Fullcalendar.createFromNode(node, config); STUDIP.Fullcalendar.createFromNode(this, config);
} }
} }
}); });
}); });
//Check if an individual booking plan is to be displayed: //Check if an individual booking plan is to be displayed:
var nodes = jQuery('.individual-booking-plan[data-resources-fullcalendar="1"]'); jQuery('.individual-booking-plan[data-resources-fullcalendar="1"]').each(function () {
jQuery.each(nodes, function (index, node) {
STUDIP.loadChunk('fullcalendar').then(() => { STUDIP.loadChunk('fullcalendar').then(() => {
STUDIP.Fullcalendar.createFromNode( STUDIP.Fullcalendar.createFromNode(
node, this,
{ {
eventPositioned: function (info, calendar_event, dom_element, view) { eventPositioned: function (info) {
var calendar_event = info.event; jQuery(info.el).droppable({
var dom_element = info.el;
var view = info.view;
jQuery(dom_element).droppable({
drop: function (event, ui_element) { drop: function (event, ui_element) {
event.preventDefault(); event.preventDefault();
......
/*jslint esversion: 6*/
// Build responsive menu on domready or resize // Build responsive menu on domready or resize
STUDIP.domReady(() => { STUDIP.domReady(() => {
const cache = STUDIP.Cache.getInstance('responsive.'); const cache = STUDIP.Cache.getInstance('responsive.');
......
...@@ -118,7 +118,7 @@ STUDIP.domReady(() => { ...@@ -118,7 +118,7 @@ STUDIP.domReady(() => {
history_timeout = setTimeout(() => { history_timeout = setTimeout(() => {
if (location.href !== url) { if (location.href !== url) {
history.pushState({ history.pushState({
needle: info.needle || STUDIP.Search.getCache().get('searchterm'), needle: info.needle || STUDIP.Search.getCache().get('searchterm'),
category: info.category category: info.category
}, '', url) }, '', url)
} }
......
...@@ -3,6 +3,14 @@ $(document).on('tourstart.studip tourend.studip', function(event) { ...@@ -3,6 +3,14 @@ $(document).on('tourstart.studip tourend.studip', function(event) {
STUDIP.Sidebar.setSticky(event.type === 'tourend.studip'); STUDIP.Sidebar.setSticky(event.type === 'tourend.studip');
}); });
function heightChangeHandler() {
var curr_height = $(document).height();
if (doc_height !== curr_height) {
doc_height = curr_height;
$(document.body).trigger('sticky_kit:recalc');
}
}
// Handle dynamic content // Handle dynamic content
if (window.MutationObserver !== undefined) { if (window.MutationObserver !== undefined) {
// Attach mutation observer to #layout_content and trigger it on // Attach mutation observer to #layout_content and trigger it on
...@@ -31,14 +39,6 @@ if (window.MutationObserver !== undefined) { ...@@ -31,14 +39,6 @@ if (window.MutationObserver !== undefined) {
// Stores document height (we will need this to check for changes) // Stores document height (we will need this to check for changes)
var doc_height; var doc_height;
function heightChangeHandler() {
var curr_height = $(document).height();
if (doc_height !== curr_height) {
doc_height = curr_height;
$(document.body).trigger('sticky_kit:recalc');
}
}
STUDIP.domReady(() => { STUDIP.domReady(() => {
doc_height = $(document).height(); doc_height = $(document).height();
}); });
......
/*jslint esversion: 6*/
STUDIP.ready(function() { STUDIP.ready(function() {
STUDIP.Statusgroups.ajax_endpoint = $('meta[name="statusgroups-ajax-movable-endpoint"]').attr('content'); STUDIP.Statusgroups.ajax_endpoint = $('meta[name="statusgroups-ajax-movable-endpoint"]').attr('content');
STUDIP.Statusgroups.apply(); STUDIP.Statusgroups.apply();
......
...@@ -185,8 +185,7 @@ function confirmation_handler(event) { ...@@ -185,8 +185,7 @@ function confirmation_handler(event) {
// so that the original event can be executed // so that the original event can be executed
element element
.removeAttr('data-confirm') .removeAttr('data-confirm')
.get(0) .get(0)[event.type]();
[event.type]();
// Reapply the data-confirm attribute // Reapply the data-confirm attribute
window.setTimeout(function() { window.setTimeout(function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment