PHP Classes

File: assets/js/admin.js

Recommend this page to a friend!
  Classes of Manolo Salsas  >  Symfony Create Bundle Skeleton  >  assets/js/admin.js  >  Download  
File: assets/js/admin.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Symfony Create Bundle Skeleton
Application to create reusable Symfony Bundles
Author: By
Last change:
Date: 2 years ago
Size: 1,997 bytes


Class file image Download
import '../scss/admin.scss'; import 'eonasdan-bootstrap-datetimepicker'; import 'typeahead.js'; import Bloodhound from "bloodhound-js"; import 'bootstrap-tagsinput'; $(function() { // Datetime picker initialization. // See $('[data-toggle="datetimepicker"]').datetimepicker({ icons: { time: 'fa fa-clock-o', date: 'fa fa-calendar', up: 'fa fa-chevron-up', down: 'fa fa-chevron-down', previous: 'fa fa-chevron-left', next: 'fa fa-chevron-right', today: 'fa fa-check-circle-o', clear: 'fa fa-trash', close: 'fa fa-remove' } }); // Bootstrap-tagsinput initialization // var $input = $('input[data-toggle="tagsinput"]'); if ($input.length) { var source = new Bloodhound({ local: $'tags'), queryTokenizer: Bloodhound.tokenizers.whitespace, datumTokenizer: Bloodhound.tokenizers.whitespace }); source.initialize(); $input.tagsinput({ trimValue: true, focusClass: 'focus', typeaheadjs: { name: 'tags', source: source.ttAdapter() } }); } }); // Handling the modal confirmation message. $(document).on('submit', 'form[data-confirmation]', function (event) { var $form = $(this), $confirm = $('#confirmationModal'); if ($'result') !== 'yes') { //cancel submit event event.preventDefault(); $confirm .off('click', '#btnYes') .on('click', '#btnYes', function () { $'result', 'yes'); $form.find('input[type="submit"]').attr('disabled', 'disabled'); $form.submit(); }) .modal('show'); } });