Unverified Commit f38b5d08 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #189 from rmemon/develop

Flash message should be fade out after certain seconds
parents 7d0b9642 0f38a012
...@@ -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: {
...@@ -149,7 +150,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -149,7 +150,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")
}, },
...@@ -158,7 +159,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -158,7 +159,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");
...@@ -441,7 +442,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -441,7 +442,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);
...@@ -456,7 +457,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -456,7 +457,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() + "]");
} }
}, },
...@@ -464,7 +465,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -464,7 +465,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');
}, },
}, },
...@@ -528,6 +529,9 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -528,6 +529,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);
}, },
...@@ -541,6 +545,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -541,6 +545,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) {
...@@ -683,6 +688,7 @@ var Backend = {}; // common variable used in all the files of the backend ...@@ -683,6 +688,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