|
259 | 259 | }); |
260 | 260 | } |
261 | 261 | } |
262 | | - //========================================================================================================================== |
263 | | - |
264 | | - /* Input - Function ======================================================================================================== |
265 | | - * You can manage the inputs(also textareas) with name of class 'form-control' |
266 | | - * |
267 | | - */ |
268 | | - $.AdminBSB.input = { |
269 | | - activate: function ($parentSelector) { |
270 | | - $parentSelector = $parentSelector || $('body'); |
271 | | - |
272 | | - //On focus event |
273 | | - $parentSelector.find('.form-control').focus(function () { |
274 | | - $(this).parent().addClass('focused'); |
275 | | - }); |
276 | | - |
277 | | - //On focusout event |
278 | | - $parentSelector.find('.form-control').focusout(function () { |
279 | | - var $this = $(this); |
280 | | - if ($this.parents('.form-group').hasClass('form-float')) { |
281 | | - if ($this.val() == '') { $this.parents('.form-line').removeClass('focused'); } |
282 | | - } |
283 | | - else { |
284 | | - $this.parents('.form-line').removeClass('focused'); |
285 | | - } |
286 | | - }); |
287 | | - |
288 | | - //On label click |
289 | | - $parentSelector.on('click', '.form-float .form-line .form-label', function () { |
290 | | - $(this).parent().find('input').focus(); |
291 | | - }); |
292 | 262 |
|
293 | | - //Not blank form |
294 | | - $parentSelector.find('.form-control').each(function () { |
295 | | - if ($(this).val() !== '') { |
296 | | - $(this).parents('.form-line').addClass('focused'); |
297 | | - } |
298 | | - }); |
299 | | - } |
300 | | - } |
301 | | - //========================================================================================================================== |
302 | | - |
303 | | - /* Form - Select - Function ================================================================================================ |
304 | | - * You can manage the 'select' of form elements |
305 | | - * |
306 | | - */ |
307 | | - $.AdminBSB.select = { |
308 | | - activate: function () { |
309 | | - if ($.fn.selectpicker) { $('select:not(.ms)').selectpicker(); } |
310 | | - } |
311 | | - } |
312 | | - //========================================================================================================================== |
313 | | - |
314 | | - /* DropdownMenu - Function ================================================================================================= |
315 | | - * You can manage the dropdown menu |
316 | | - * |
317 | | - */ |
318 | | - |
319 | | - $.AdminBSB.dropdownMenu = { |
320 | | - activate: function () { |
321 | | - var _this = this; |
322 | | - |
323 | | - $('.dropdown, .dropup, .btn-group').on({ |
324 | | - "show.bs.dropdown": function () { |
325 | | - var dropdown = _this.dropdownEffect(this); |
326 | | - _this.dropdownEffectStart(dropdown, dropdown.effectIn); |
327 | | - }, |
328 | | - "shown.bs.dropdown": function () { |
329 | | - var dropdown = _this.dropdownEffect(this); |
330 | | - if (dropdown.effectIn && dropdown.effectOut) { |
331 | | - _this.dropdownEffectEnd(dropdown, function () { }); |
332 | | - } |
333 | | - }, |
334 | | - "hide.bs.dropdown": function (e) { |
335 | | - var dropdown = _this.dropdownEffect(this); |
336 | | - if (dropdown.effectOut) { |
337 | | - e.preventDefault(); |
338 | | - _this.dropdownEffectStart(dropdown, dropdown.effectOut); |
339 | | - _this.dropdownEffectEnd(dropdown, function () { |
340 | | - dropdown.dropdown.removeClass('open'); |
341 | | - }); |
342 | | - } |
343 | | - } |
344 | | - }); |
345 | | - |
346 | | - //Set Waves |
347 | | - Waves.attach('.dropdown-menu li a', ['waves-block']); |
348 | | - Waves.init(); |
349 | | - }, |
350 | | - dropdownEffect: function (target) { |
351 | | - var effectIn = $.AdminBSB.options.dropdownMenu.effectIn, effectOut = $.AdminBSB.options.dropdownMenu.effectOut; |
352 | | - var dropdown = $(target), dropdownMenu = $('.dropdown-menu', target); |
353 | | - |
354 | | - if (dropdown.length > 0) { |
355 | | - var udEffectIn = dropdown.data('effect-in'); |
356 | | - var udEffectOut = dropdown.data('effect-out'); |
357 | | - if (udEffectIn !== undefined) { effectIn = udEffectIn; } |
358 | | - if (udEffectOut !== undefined) { effectOut = udEffectOut; } |
359 | | - } |
360 | | - |
361 | | - return { |
362 | | - target: target, |
363 | | - dropdown: dropdown, |
364 | | - dropdownMenu: dropdownMenu, |
365 | | - effectIn: effectIn, |
366 | | - effectOut: effectOut |
367 | | - }; |
368 | | - }, |
369 | | - dropdownEffectStart: function (data, effectToStart) { |
370 | | - if (effectToStart) { |
371 | | - data.dropdown.addClass('dropdown-animating'); |
372 | | - data.dropdownMenu.addClass('animated dropdown-animated'); |
373 | | - data.dropdownMenu.addClass(effectToStart); |
374 | | - } |
375 | | - }, |
376 | | - dropdownEffectEnd: function (data, callback) { |
377 | | - var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; |
378 | | - data.dropdown.one(animationEnd, function () { |
379 | | - data.dropdown.removeClass('dropdown-animating'); |
380 | | - data.dropdownMenu.removeClass('animated dropdown-animated'); |
381 | | - data.dropdownMenu.removeClass(data.effectIn); |
382 | | - data.dropdownMenu.removeClass(data.effectOut); |
383 | | - |
384 | | - if (typeof callback == 'function') { |
385 | | - callback(); |
386 | | - } |
387 | | - }); |
388 | | - } |
389 | | - } |
390 | 263 | //========================================================================================================================== |
391 | 264 |
|
392 | 265 | /* Browser - Function ====================================================================================================== |
|
458 | 331 | $.AdminBSB.leftSideBar.activate(); |
459 | 332 | $.AdminBSB.rightSideBar.activate(); |
460 | 333 | $.AdminBSB.navbar.activate(); |
461 | | - //$.AdminBSB.dropdownMenu.activate(); //Breaks drop downs, so disabled it! |
462 | | - $.AdminBSB.input.activate(); |
463 | | - $.AdminBSB.select.activate(); |
464 | 334 | $.AdminBSB.search.activate(); |
465 | 335 | } |
466 | 336 |
|
|
0 commit comments