[FIX] jQuery.ui - boostrap conflicts
authorFabien Meghazi <fme@openerp.com>
Tue, 6 May 2014 15:33:00 +0000 (17:33 +0200)
committerFabien Meghazi <fme@openerp.com>
Tue, 6 May 2014 15:33:00 +0000 (17:33 +0200)
bzr revid: fme@openerp.com-20140506153300-0p1gwnrxihpb4y3r

addons/web/views/webclient_templates.xml

index 2c3a16a..f3a490c 100644 (file)
             <link rel="stylesheet" href="/web/static/lib/fontawesome/css/font-awesome.css"/>
         </template>
 
+        <template id="jqueryui_conflict" name="jquery.ui.conflict">
+            <!-- TODO: get rid of this hack once jQuery.ui is removed -->
+            <script type="text/javascript" charset="utf-8">
+                $.fn.bstooltip = $.fn.tooltip;
+            </script>
+            <t t-raw="0"/>
+            <script type="text/javascript" charset="utf-8">
+                $.fn.tooltip = $.fn.bstooltip;
+            </script>
+        </template>
+
         <template id="web.assets_backend">
             <t t-call="web.assets_common"/>
             <!-- Datejs -->
             <link rel="stylesheet" href="/web/static/lib/select2/select2.css"/>
             <script type="text/javascript" src="/web/static/lib/select2/select2.js"></script>
 
+            <link rel="stylesheet" href="/web/static/lib/bootstrap/css/bootstrap.css"/>
+            <script type="text/javascript" src="/web/static/lib/bootstrap/js/bootstrap.js"></script>
 
             <!-- jQuery ui -->
             <link rel="stylesheet" href="/web/static/lib/jquery.ui.bootstrap/css/custom-theme/jquery-ui-1.9.0.custom.css"/>
-            <script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
+
+            <t t-call="web.jqueryui_conflict">
+                <script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
+            </t>
 
             <link rel="stylesheet" href="/web/static/lib/jquery.ui.timepicker/css/jquery-ui-timepicker-addon.css"/>
             <script type="text/javascript" src="/web/static/lib/jquery.ui.timepicker/js/jquery-ui-timepicker-addon.js"></script>
@@ -56,9 +72,6 @@
             <link rel="stylesheet" href="/web/static/lib/jquery.ui.notify/css/ui.notify.css"/>
             <script type="text/javascript" src="/web/static/lib/jquery.ui.notify/js/jquery.notify.js"></script>
 
-            <!-- Bootstrap must be loaded after jquery.ui until jquery.ui is removed -->
-            <link rel="stylesheet" href="/web/static/lib/bootstrap/css/bootstrap.css"/>
-            <script type="text/javascript" src="/web/static/lib/bootstrap/js/bootstrap.js"></script>
 
             <!-- Backbone -->
             <script type="text/javascript" src="/web/static/lib/backbone/backbone.js"></script>