diff --git a/addons/website/static/src/css/snippets.css b/addons/website/static/src/css/snippets.css index 628689b78cf..35d78303aae 100644 --- a/addons/website/static/src/css/snippets.css +++ b/addons/website/static/src/css/snippets.css @@ -1,3 +1,13 @@ +/* add CSS for bootstrap dropdown multi level */ +.dropdown-submenu{position:relative;} +.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} +.dropdown-submenu:hover>.dropdown-menu{display:block;} +.dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;} +.dropdown-submenu:hover>a:after{border-left-color:#ffffff;} +.dropdown-submenu.pull-left{float:none;} +.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;} + + /* .oe_snippet_demo .oe_page{ margin-top: 50px; @@ -208,14 +218,3 @@ min-width: 10px; } - -/* Custom CSS for snippets */ -.carousel.oe_small .carousel-inner { - height: 200px; -} -.carousel.oe_medium .carousel-inner { - height: 300px; -} -.carousel.oe_big .carousel-inner { - height: 450px; -} diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index c48d4fa9b2a..20a0968347a 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -246,6 +246,15 @@ footer { height: 100%; } +.carousel.oe_small .carousel-inner { + height: 200px; +} +.carousel.oe_medium .carousel-inner { + height: 300px; +} +.carousel.oe_big .carousel-inner { + height: 450px; +} .carousel .carousel-caption h1, .carousel .carousel-caption h2, .carousel .carousel-caption h3 { margin-top: 10px; margin-bottom: 10px; @@ -271,7 +280,7 @@ footer { background: rgba(0, 0, 0, 0.4); } .carousel .item.text_only .carousel-image { - display: none; + display: none !important; } .carousel .item.text_only .carousel-caption { left: 10%; @@ -291,6 +300,20 @@ footer { right: 50%; left: 10%; } +.carousel .carousel-control { + cursor: pointer; +} +.carousel .carousel-control span { + top: 50%; + position: absolute; + margin-top: -8px; +} +.carousel .carousel-control.left span { + left: 10px; +} +.carousel .carousel-control.right span { + right: 10px; +} /* ---- HOMEPAGE THEME CUSTOMIZATION ---- */ .dark { diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index 9f7efa2c416..2511cb55d9e 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -177,7 +177,14 @@ footer .carousel-inner .item height: 100% + .carousel + &.oe_small .carousel-inner + height: 200px + &.oe_medium .carousel-inner + height: 300px + &.oe_big .carousel-inner + height: 450px .carousel-caption h1, h2, h3 margin-top: 10px @@ -202,7 +209,7 @@ footer background: rgba(0, 0, 0, 0.4) .item.text_only .carousel-image - display: none + display: none !important .carousel-caption left: 10% right: 10% @@ -219,6 +226,16 @@ footer .carousel-image right: 50% left: 10% + .carousel-control + cursor: pointer + span + top: 50% + position: absolute + margin-top: -8px + &.left span + left: 10px + &.right span + right: 10px /* ---- HOMEPAGE THEME CUSTOMIZATION ---- */ diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js index 3457fbb66e2..44e30d612e3 100644 --- a/addons/website/static/src/js/website.snippets.js +++ b/addons/website/static/src/js/website.snippets.js @@ -28,6 +28,7 @@ return this._super.apply(this, arguments); }, save: function () { + this.snippets.make_active(false); remove_added_snippet_id(); this._super(); }, @@ -106,9 +107,11 @@ var $ul = this.parent.$("#website-top-edit ul"); - var $button = $(openerp.qweb.render('website.snippets_button')) - .click(function () {self.$el.toggleClass("hidden");}) - .prependTo($ul); + var $button = $(openerp.qweb.render('website.snippets_button')).prependTo($ul); + $button.find('button').click(function () { + self.make_active(false); + self.$el.toggleClass("hidden"); + }); this.fetch_snippet_templates(); @@ -568,14 +571,6 @@ * Called after onBlur of snippet editor */ onBlurEdit : function () {}, - - /* getOptions - * Read data saved for your snippet animation. - */ - getOptions: function () { - var options = this.$el.data("snippet-options"); - return options ? JSON.parse(options) : undefined; - }, }); @@ -626,8 +621,7 @@ // activate drag and drop for the snippets in the snippet toolbar _drag_and_drop: function(){ var self = this; - var dropped = false; - var $move = this.$overlay.find(".oe_snippet_move"); + this.dropped = false; this.$overlay.draggable({ greedy: true, appendTo: 'body', @@ -639,49 +633,67 @@ }, helper: function() { var $clone = $(this).clone().css({width: "24px", height: "24px", border: 0}); - $clone.find(".oe_overlay_options >:not(.oe_snippet_move), .oe_handle").remove(); + $clone.find(".oe_overlay_options >:not(:contains(.oe_snippet_move)), .oe_handle").remove(); $clone.find(":not(.glyphicon)").css({position: 'absolute', top: 0, left: 0}); - return $clone.appendTo("body").removeClass("hidden"); + $clone.appendTo("body").removeClass("hidden"); + return $clone; }, - start: function(){ - self.parent.hide(); - self.parent.editor_busy = true; - self.$target.after("