Fix indents
This commit is contained in:
parent
ddc7d11c99
commit
c224536472
|
@ -13,23 +13,23 @@ var loader_html = '<div class="preloader"> \
|
||||||
</div> \
|
</div> \
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
$( document ).ready(function() {
|
$(document).ready(function () {
|
||||||
remove_init_form();
|
remove_init_form();
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When a sidebar item is clicked in mobile - let's make sure we push the sidebar back in
|
* When a sidebar item is clicked in mobile - let's make sure we push the sidebar back in
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document).on('on_pjax_complete',function(){
|
$(document).on('on_pjax_complete', function () {
|
||||||
if($('.ls-closed').length > 0){
|
if ($('.ls-closed').length > 0) {
|
||||||
$('body').removeClass('overlay-open');
|
$('body').removeClass('overlay-open');
|
||||||
$('.overlay').css("display", "none");
|
$('.overlay').css("display", "none");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Form input focus event
|
* Form input focus event
|
||||||
*/
|
*/
|
||||||
$('.form-control').focus(function () {
|
$('.form-control').focus(function () {
|
||||||
$(this).parent().addClass('focused');
|
$(this).parent().addClass('focused');
|
||||||
});
|
});
|
||||||
|
@ -38,7 +38,9 @@ $(document).on('on_pjax_complete',function(){
|
||||||
$('.form-control').focusout(function () {
|
$('.form-control').focusout(function () {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
if ($this.parents('.form-group').hasClass('form-float')) {
|
if ($this.parents('.form-group').hasClass('form-float')) {
|
||||||
if ($this.val() == '') { $this.parents('.form-line').removeClass('focused'); }
|
if ($this.val() == '') {
|
||||||
|
$this.parents('.form-line').removeClass('focused');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this.parents('.form-line').removeClass('focused');
|
$this.parents('.form-line').removeClass('focused');
|
||||||
|
@ -62,113 +64,113 @@ $(document).on('on_pjax_complete',function(){
|
||||||
remove_init_form();
|
remove_init_form();
|
||||||
});
|
});
|
||||||
|
|
||||||
function remove_init_form(){
|
function remove_init_form() {
|
||||||
setTimeout(function(){
|
setTimeout(function () {
|
||||||
$('.form-line').removeClass("focused");
|
$('.form-line').removeClass("focused");
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
function modal (title, content, buttons) {
|
function modal(title, content, buttons) {
|
||||||
$('#modal-buttons').html('');
|
$('#modal-buttons').html('');
|
||||||
$('#modal-title').html(title);
|
$('#modal-title').html(title);
|
||||||
$('#modal-body').html(content);
|
$('#modal-body').html(content);
|
||||||
|
|
||||||
// <button type="button" class="btn btn-link waves-effect">SAVE CHANGES</button>
|
// <button type="button" class="btn btn-link waves-effect">SAVE CHANGES</button>
|
||||||
if(buttons != '') {
|
if (buttons != '') {
|
||||||
$('#modal-buttons').html(buttons);
|
$('#modal-buttons').html(buttons);
|
||||||
}
|
}
|
||||||
$('#mdModal').modal('show');
|
$('#mdModal').modal('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_form_query_string(form_id){
|
function get_form_query_string(form_id) {
|
||||||
query_string = "";
|
query_string = "";
|
||||||
$('#' + form_id).find('input, select, textarea').each(function (key) {
|
$('#' + form_id).find('input, select, textarea').each(function (key) {
|
||||||
val = $(this).val();
|
val = $(this).val();
|
||||||
if (val == 'undefined') {
|
if (val == 'undefined') {
|
||||||
val = '';
|
val = '';
|
||||||
}
|
}
|
||||||
if($(this).attr('type') == "checkbox"){
|
if ($(this).attr('type') == "checkbox") {
|
||||||
if (!$(this).is(':checked')) {
|
if (!$(this).is(':checked')) {
|
||||||
val = 0;
|
val = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
query_string = query_string + "&" + $(this).attr('id') + "=" + encodeURIComponent(val);
|
query_string = query_string + "&" + $(this).attr('id') + "=" + encodeURIComponent(val);
|
||||||
});
|
});
|
||||||
return query_string;
|
return query_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function save_config() {
|
function save_config() {
|
||||||
glass_settings = get_form_query_string("glass-settings-form");
|
glass_settings = get_form_query_string("glass-settings-form");
|
||||||
|
|
||||||
$.post( "/glass_settings_save", glass_settings, function( data ) {
|
$.post("/glass_settings_save", glass_settings, function (data) {
|
||||||
$( "#glass_settings_result" ).html( data );
|
$("#glass_settings_result").html(data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function notification(text){
|
function notification(text) {
|
||||||
colorName = 'bg-black';
|
colorName = 'bg-black';
|
||||||
animateEnter = 'animated fadeInDown';
|
animateEnter = 'animated fadeInDown';
|
||||||
animateExit = 'animated fadeOutUp';
|
animateExit = 'animated fadeOutUp';
|
||||||
var allowDismiss = true;
|
var allowDismiss = true;
|
||||||
|
|
||||||
$.notify({
|
$.notify({
|
||||||
message: text
|
message: text
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: colorName,
|
type: colorName,
|
||||||
allow_dismiss: allowDismiss,
|
allow_dismiss: allowDismiss,
|
||||||
newest_on_top: true,
|
newest_on_top: true,
|
||||||
timer: 1000,
|
timer: 1000,
|
||||||
animate: {
|
animate: {
|
||||||
enter: animateEnter,
|
enter: animateEnter,
|
||||||
exit: animateExit
|
exit: animateExit
|
||||||
},
|
},
|
||||||
template: '<div data-notify="container" class="bootstrap-notify-container alert alert-dismissible {0} ' + (allowDismiss ? "p-r-35" : "") + '" role="alert">' +
|
template: '<div data-notify="container" class="bootstrap-notify-container alert alert-dismissible {0} ' + (allowDismiss ? "p-r-35" : "") + '" role="alert">' +
|
||||||
'<button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button>' +
|
'<button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button>' +
|
||||||
'<span data-notify="icon"></span> ' +
|
'<span data-notify="icon"></span> ' +
|
||||||
'<span data-notify="title">{1}</span> ' +
|
'<span data-notify="title">{1}</span> ' +
|
||||||
'<span data-notify="message">{2}</span>' +
|
'<span data-notify="message">{2}</span>' +
|
||||||
'<div class="progress" data-notify="progressbar">' +
|
'<div class="progress" data-notify="progressbar">' +
|
||||||
'<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
|
'<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<a href="{3}" target="{4}" data-notify="url"></a>' +
|
'<a href="{3}" target="{4}" data-notify="url"></a>' +
|
||||||
'</div>'
|
'</div>'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function change_favicon(img) {
|
function change_favicon(img) {
|
||||||
var favicon = document.querySelector('link[rel="shortcut icon"]');
|
var favicon = document.querySelector('link[rel="shortcut icon"]');
|
||||||
|
|
||||||
if (!favicon) {
|
if (!favicon) {
|
||||||
favicon = document.createElement('link');
|
favicon = document.createElement('link');
|
||||||
favicon.setAttribute('rel', 'shortcut icon');
|
favicon.setAttribute('rel', 'shortcut icon');
|
||||||
var head = document.querySelector('head');
|
var head = document.querySelector('head');
|
||||||
head.appendChild(favicon);
|
head.appendChild(favicon);
|
||||||
}
|
}
|
||||||
|
|
||||||
favicon.setAttribute('type', 'image/png');
|
favicon.setAttribute('type', 'image/png');
|
||||||
favicon.setAttribute('href', img);
|
favicon.setAttribute('href', img);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on("click",".option_data",function() {
|
$(document).on("click", ".option_data", function () {
|
||||||
var lease = $(this).attr("lease");
|
var lease = $(this).attr("lease");
|
||||||
if ( $("#" + lease).is(":visible") ) {
|
if ($("#" + lease).is(":visible")) {
|
||||||
$("#" + lease).hide();
|
$("#" + lease).hide();
|
||||||
$(this).text('Show');
|
$(this).text('Show');
|
||||||
} else if ( $("#" + lease).is(":hidden") ) {
|
} else if ($("#" + lease).is(":hidden")) {
|
||||||
$("#" + lease).show();
|
$("#" + lease).show();
|
||||||
$(this).text('Hide');
|
$(this).text('Hide');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("keypress","#lease_search_criteria", function(e) {
|
$(document).on("keypress", "#lease_search_criteria", function (e) {
|
||||||
if (e.which == 13) {
|
if (e.which == 13) {
|
||||||
$('#search_result').html(loader_html);
|
$('#search_result').html(loader_html);
|
||||||
$.post("/dhcp_lease_search", { search: $("#lease_search_criteria").val() }, function(result) {
|
$.post("/dhcp_lease_search", {search: $("#lease_search_criteria").val()}, function (result) {
|
||||||
$("#search_result").html(result);
|
$("#search_result").html(result);
|
||||||
|
|
||||||
if(typeof display_leases !== "undefined")
|
if (typeof display_leases !== "undefined")
|
||||||
display_leases.destroy();
|
display_leases.destroy();
|
||||||
|
|
||||||
display_leases = $('#display-leases').DataTable({
|
display_leases = $('#display-leases').DataTable({
|
||||||
dom: 'tip',
|
dom: 'tip',
|
||||||
|
|
Loading…
Reference in New Issue