Commit 0f38a012 authored by rahil's avatar rahil

Flash message should be fade out after certain seconds

- Flash message on update or add record should be fade out after certain seconds
- use jQuery instead on $ for noConflict code
parent 191033ca
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
var Backend = {}; // common variable used in all the files of the backend var Backend = {}; // common variable used in all the files of the backend
(function (){ (function (){
Backend = { Backend = {
Utils: { Utils: {
...@@ -151,7 +152,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -151,7 +152,7 @@ var Backend = {}; // common variable used in all the files of the backend
Users: Users:
{ {
selectors: { selectors: {
select2: $(".select2"), select2: jQuery(".select2"),
getPremissionURL: "", getPremissionURL: "",
showPermission: document.querySelectorAll(".show-permissions") showPermission: document.querySelectorAll(".show-permissions")
}, },
...@@ -160,7 +161,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -160,7 +161,7 @@ var Backend = {}; // common variable used in all the files of the backend
this.addHandlers(page); this.addHandlers(page);
}, },
setSelectors: function () { setSelectors: function () {
this.selectors.select2 = $(".select2"); this.selectors.select2 = jQuery(".select2");
this.selectors.getRoleForPermissions = document.querySelectorAll(".get-role-for-permissions"); this.selectors.getRoleForPermissions = document.querySelectorAll(".get-role-for-permissions");
this.selectors.getAvailabelPermissions = document.querySelector(".get-available-permissions"); this.selectors.getAvailabelPermissions = document.querySelector(".get-available-permissions");
this.selectors.Role3 = document.getElementById("role-3"); this.selectors.Role3 = document.getElementById("role-3");
...@@ -443,7 +444,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -443,7 +444,7 @@ var Backend = {}; // common variable used in all the files of the backend
// ! Backend.emailTemplate.addHandlers // ! Backend.emailTemplate.addHandlers
addHandlers: function () { addHandlers: function () {
$(".select2").select2(); jQuery(".select2").select2();
// to add placeholder in to active textarea // to add placeholder in to active textarea
document.getElementById("addPlaceHolder").onclick = function (event) { document.getElementById("addPlaceHolder").onclick = function (event) {
Backend.emailTemplate.addPlaceHolder(event); Backend.emailTemplate.addPlaceHolder(event);
...@@ -458,7 +459,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -458,7 +459,7 @@ var Backend = {}; // common variable used in all the files of the backend
addPlaceHolder: function (event) { addPlaceHolder: function (event) {
var placeHolder = document.getElementById('placeHolder').value; var placeHolder = document.getElementById('placeHolder').value;
if (placeHolder != '') { if (placeHolder != '') {
tinymce.activeEditor.execCommand('mceInsertContent', false, "[" + $('#placeHolder :selected').text() + "]"); tinymce.activeEditor.execCommand('mceInsertContent', false, "[" + jQuery('#placeHolder :selected').text() + "]");
} }
}, },
...@@ -466,7 +467,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -466,7 +467,7 @@ var Backend = {}; // common variable used in all the files of the backend
showPreview: function (event) { showPreview: function (event) {
document.querySelector(".modal-body").innerHTML = tinyMCE.get('txtBody').getContent(); document.querySelector(".modal-body").innerHTML = tinyMCE.get('txtBody').getContent();
//jQuery( ".modal-body" ).html(tinyMCE.get('txtBody').getContent()); //jQuery( ".modal-body" ).html(tinyMCE.get('txtBody').getContent());
$(".model-wrapper").modal('show'); jQuery(".model-wrapper").modal('show');
}, },
}, },
...@@ -531,6 +532,9 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -531,6 +532,9 @@ var Backend = {}; // common variable used in all the files of the backend
init: function (dataTable) { init: function (dataTable) {
this.setSelectors(); this.setSelectors();
this.setSelectors.divAlerts.delay(2000).fadeOut(800);
this.addHandlers(dataTable); this.addHandlers(dataTable);
}, },
...@@ -544,6 +548,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -544,6 +548,7 @@ var Backend = {}; // common variable used in all the files of the backend
this.setSelectors.excelButton = document.getElementById("excelButton"); this.setSelectors.excelButton = document.getElementById("excelButton");
this.setSelectors.pdfButton = document.getElementById("pdfButton"); this.setSelectors.pdfButton = document.getElementById("pdfButton");
this.setSelectors.printButton = document.getElementById("printButton"); this.setSelectors.printButton = document.getElementById("printButton");
this.setSelectors.divAlerts = jQuery('div.alert').not('.alert-important');
}, },
cloneElement: function (element, callback) { cloneElement: function (element, callback) {
...@@ -684,6 +689,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -684,6 +689,7 @@ var Backend = {}; // common variable used in all the files of the backend
} }
} }
}; };
})(); })();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment