Skip to content

Instantly share code, notes, and snippets.

View andrew-svirin's full-sized avatar
👾

Andrew Svirin andrew-svirin

👾
View GitHub Profile
/**
* Make bootstrap modal dialogs stackable.
*/
$(document).on('show.bs.modal', '.modal', function () {
const zIndex = 1040 + (10 * $('.modal:visible').length);
$(this).css('z-index', zIndex);
setTimeout(function() {
$('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack');
}, 0);
});
<?php
/**
* Sorting class for array of associative arrays.
*
* Allows sort array by children array field value.
*
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*
* @example
* ```php
/**
* Example ```javascript
* let objects = $.fn.findCreatedUpdatedDeleted(
* [{id:1, v:1}, {id:2, v:2}, {id:4, v:4}],
* [{id:null, v:3}, {id:2, v:3}, {id:4, v:5}],
* 'id',
* ['v'],
* 'new-'
* );
* console.log('result', objects);