fix datepicker noconflict
This commit is contained in:
parent
9136f8d34a
commit
b1e96ef177
src/inputs/date
@ -958,7 +958,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var old = $.fn.datepicker;
|
var old = $.fn.datepicker;
|
||||||
$.fn.datepicker = function ( option ) {
|
var datepicker = $.fn.datepicker = function ( option ) {
|
||||||
var args = Array.apply(null, arguments);
|
var args = Array.apply(null, arguments);
|
||||||
args.shift();
|
args.shift();
|
||||||
var internal_return,
|
var internal_return,
|
||||||
@ -1242,11 +1242,13 @@
|
|||||||
if ($this.data('datepicker')) return;
|
if ($this.data('datepicker')) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// component click requires us to explicitly show it
|
// component click requires us to explicitly show it
|
||||||
$this.datepicker('show');
|
datepicker.call($this, 'show');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
$(function(){
|
$(function(){
|
||||||
$('[data-provide="datepicker-inline"]').datepicker();
|
//$('[data-provide="datepicker-inline"]').datepicker();
|
||||||
|
//vit: changed to support noConflict()
|
||||||
|
datepicker.call($('[data-provide="datepicker-inline"]'));
|
||||||
});
|
});
|
||||||
|
|
||||||
}( window.jQuery ));
|
}( window.jQuery ));
|
||||||
|
@ -27,7 +27,10 @@ $(function(){
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
//store bootstrap-datepicker as bdateicker to exclude conflict with jQuery UI one
|
//store bootstrap-datepicker as bdateicker to exclude conflict with jQuery UI one
|
||||||
$.fn.bdatepicker = $.fn.datepicker.noConflict();
|
$.fn.bdatepicker = $.fn.datepicker.noConflict();
|
||||||
|
if(!$.fn.datepicker) { //if there were no other datepickers, keep also original name
|
||||||
|
$.fn.datepicker = $.fn.bdatepicker;
|
||||||
|
}
|
||||||
|
|
||||||
var Date = function (options) {
|
var Date = function (options) {
|
||||||
this.init('date', options, Date.defaults);
|
this.init('date', options, Date.defaults);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user