vitalets / x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
http://vitalets.github.io/x-editable
MIT License
6.51k stars 1.72k forks source link

Conflicts with date time picker #940

Open adameska opened 7 years ago

adameska commented 7 years ago

This control directly interferes with https://github.com/uxsolutions/bootstrap-datepicker can the CSS in this class be namespaced so we don't have that issue?

adameska commented 7 years ago

https://jsfiddle.net/warhawke08/uymqbp35/3/

adamthehutt commented 7 years ago

+1

SirRawlins commented 7 years ago

Also seeing conflicts with https://github.com/Eonasdan/bootstrap-datetimepicker. Name-spacing this stuff would make perfect sense.

NashBridgesAT commented 7 years ago

is there a solution for that? have the same problem...

Smtgr14 commented 7 years ago

For those needing these plugins to run side by side and don't need to use the datepicker in your editable objects, delete lines 224 - 290 of the css/bootstrap-editable file to prevent conflicts. I don't recommend this, but it works for now until someone gets around to properly name-spacing these stylesheets.

NashBridgesAT commented 7 years ago

I have found another workaround solution, which works for me (don't know why, I have no experience with css namespaces). I've added following line at the very beginning of bootstrap-editable.css

@namespace 'e';

nev3rmi commented 6 years ago

I fixed it on Bootstrap-Datetimepicker.Js In the same theory, you can fix it on datepicker.js

showMode = function (dir) { if (!widget) { return; } if (dir) { currentViewMode = Math.max(minViewModeNumber, Math.min(3, currentViewMode + dir)); } widget.find('.datepicker > div').hide().filter('.datepicker-' + datePickerModes[currentViewMode].clsName).show(); }

Change to this: showMode = function (dir) { if (!widget) { return; } if (dir) { currentViewMode = Math.max(minViewModeNumber, Math.min(3, currentViewMode + dir)); } widget.find('.datepicker > div').hide().filter('.datepicker-' + datePickerModes[currentViewMode].clsName).show(); // FINISH: Fix BUGS XEditable with Datetimepicker :) By NeV3RmI if (datePickerModes[currentViewMode].clsName == "days"){ widget.find('.datepicker > div:first-of-type').css('display', 'inherit'); } if (datePickerModes[currentViewMode].clsName == "months"){ widget.find('.datepicker > div:nth-of-type(2)').css('display', 'inherit'); } if (datePickerModes[currentViewMode].clsName == "years"){ widget.find('.datepicker > div:nth-of-type(3)').css('display', 'inherit'); } if (datePickerModes[currentViewMode].clsName == "decades"){ widget.find('.datepicker > div:nth-of-type(4)').css('display', 'inherit'); } // console.log(datePickerModes[currentViewMode].clsName); }