diff --git a/sapl-frontend/src/apps/compilacao/js/old/compilacao_edit.js b/sapl-frontend/src/apps/compilacao/js/old/compilacao_edit.js index 98b78e3a0..087176849 100644 --- a/sapl-frontend/src/apps/compilacao/js/old/compilacao_edit.js +++ b/sapl-frontend/src/apps/compilacao/js/old/compilacao_edit.js @@ -97,8 +97,8 @@ window.DispositivoEdit = function () { let btn_fechar = _this.find('.btn-fechar') btn_fechar.on('click', function (event) { - event.preventDefault() instance.clearEditSelected() + event.preventDefault() }) let btns_excluir = _this.find('.btns-excluir') @@ -123,7 +123,8 @@ window.DispositivoEdit = function () { dpt_form.submit(instance.onSubmitFormRegistraAlteracao) let btn_fechar = _this.find('.btn-fechar') - btn_fechar.on('click', function () { + btn_fechar.on('click', function (event) { + event.preventDefault() instance.clearEditSelected() instance.triggerBtnDptEdit(_this.attr('pk')) }) @@ -148,9 +149,10 @@ window.DispositivoEdit = function () { dpt_form.submit(instance.onSubmitFormRegistraInclusao) let btn_fechar = _this.find('.btn-fechar') - btn_fechar.on('click', function () { + btn_fechar.on('click', function (event) { instance.clearEditSelected() instance.triggerBtnDptEdit(_this.attr('pk')) + event.preventDefault() }) } @@ -316,7 +318,7 @@ window.DispositivoEdit = function () { instance.waitShow() // eslint-disable-next-line - _$.post(url, form_data, dataType = 'json') + _$.post(url, form_data) .done(function (data) { instance.clearEditSelected() diff --git a/sapl/static/js/app.js b/sapl/static/js/app.js deleted file mode 100644 index 2a472e289..000000000 --- a/sapl/static/js/app.js +++ /dev/null @@ -1,115 +0,0 @@ - -function initTinymce(elements, readonly=false) { - removeTinymce(); - var config_tinymce = { - force_br_newlines : false, - force_p_newlines : false, - forced_root_block : '', - plugins: ["table save code"], - menubar: "edit format table tools", - toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent", - tools: "inserttable", - } - - if (readonly) { - config_tinymce.readonly = 1; - config_tinymce.menubar = false; - config_tinymce.toolbar = false; - } - - if (elements != null) { - config_tinymce['elements'] = elements; - config_tinymce['mode'] = "exact"; - } - else - config_tinymce['mode'] = "textareas"; - - tinymce.init(config_tinymce); -} - -function removeTinymce() { - while (tinymce.editors.length > 0) { - tinymce.remove(tinymce.editors[0]); - } -} - - - -function OptionalCustomFrontEnd() { - // Adaptações opcionais de layout com a presença de JS. - // Não implementar customizações que a funcionalidade que fique dependente. - var instance; - if (!(this instanceof OptionalCustomFrontEnd)) { - if (!instance) { - instance = new OptionalCustomFrontEnd(); - } - return instance; - } - instance = this; - OptionalCustomFrontEnd = function() { - return instance; - } - instance.customCheckBoxAndRadio = function() { - $('[type=radio], [type=checkbox]').each(function() { - var _this = $(this) - var _controls = _this.closest('.controls'); - _controls && _controls.find(':file').length == 0 && !_controls.hasClass('controls-radio-checkbox') && _controls.addClass('controls-radio-checkbox'); - _controls.find(':file').length > 0 && _controls.addClass('controls-file'); - }); - } - instance.customCheckBoxAndRadioWithoutLabel = function() { - - $('[type=radio], [type=checkbox]').each(function() { - let _this = $(this) - - if (this.id === undefined || this.id.length === 0) { - return - } - - let _label = _this.closest('label') - - if (_label.length === 0) { - _label = $('label[for='+this.id+']'); - if (_label.length === 0) { - _label = $('