From 9c6d0b354a11a477af4e6216fccb05d328b77db7 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Mon, 11 Aug 2014 20:35:31 +0200 Subject: [PATCH] [fix] bootstrap 3.2.0: hack to embed js needed for some components Some components can be used without javascript function calls, only by setting some html attributes or classes, allowing to use them without writing specific BSL bindings. E.g. data-toggle="dropdown" --- lib/stdlib/themes/bootstrap/core/core.opa | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/stdlib/themes/bootstrap/core/core.opa b/lib/stdlib/themes/bootstrap/core/core.opa index 170ea63f..92656ee1 100644 --- a/lib/stdlib/themes/bootstrap/core/core.opa +++ b/lib/stdlib/themes/bootstrap/core/core.opa @@ -122,6 +122,12 @@ Bootstrap = {{ {some=url} -> Resource.register_external_css(url) {none} -> void + @private + import_bs_js(name:string) = + match Map.get(name, uri_bs) + {some=url} -> Resource.register_external_js(url) + {none} -> void + @private fallback_url(v:string) = if String.le(v, "1.4.0") then @@ -142,6 +148,8 @@ Bootstrap = {{ import_responsive_css(v:string) = // responsive only if String.lt(v, "3.0.0") then import_bs("{bs_resources_path}/{v}/css/bootstrap-responsive.min.css") + else + import_bs_js("{bs_resources_path}/{v}/js/bootstrap.min.js") @package import_icons(v:string) = // icons only