PluginProbe
QuadMenu – Mega Menu / 1.8.8
QuadMenu – Mega Menu v1.8.8
3.3.8 3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 88 releases
quadmenu / lib / ReduxCore / inc / fields / date / field_date.js

field_date.js in QuadMenu – Mega Menu 1.8.8, at lib/ReduxCore/inc/fields/date/field_date.js

60 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*global jQuery, document, redux*/
2
3 (function( $ ) {
4 "use strict";
5
6 redux.field_objects = redux.field_objects || {};
7 redux.field_objects.date = redux.field_objects.date || {};
8
9 $( document ).ready(
10 function() {
11 //redux.field_objects.date.init();
12 }
13 );
14
15 redux.field_objects.date.init = function( selector ) {
16 if ( !selector ) {
17 selector = $( document ).find( '.redux-container-date:visible' );
18 }
19 $( selector ).each(
20 function() {
21 var el = $( this );
22 var parent = el;
23 if ( !el.hasClass( 'redux-field-container' ) ) {
24 parent = el.parents( '.redux-field-container:first' );
25 }
26 if ( parent.is( ":hidden" ) ) { // Skip hidden fields
27 return;
28 }
29 if ( parent.hasClass( 'redux-field-init' ) ) {
30 parent.removeClass( 'redux-field-init' );
31 } else {
32 return;
33 }
34
35 el.find( '.redux-datepicker' ).each( function() {
36 $( this ).datepicker({
37 "dateFormat":"mm/dd/yy",
38 beforeShow: function(input, instance){
39 var el = $('#ui-datepicker-div');
40 var popover = instance.dpDiv;
41 //$('.redux-container:first').append(el);
42 $(this).parent().append(el);
43 $('#ui-datepicker-div').hide();
44 setTimeout(function() {
45 popover.position({
46 my: 'left top',
47 at: 'left bottom',
48 collision: 'none',
49 of: input
50 });
51 }, 1);
52 }
53 });
54 });
55 }
56 );
57
58
59 };
60 })( jQuery );