diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index fab545d09b8..cae703450bb 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -435,13 +435,6 @@ background-image: -o-linear-gradient(top, #646060, #262626); background-image: linear-gradient(to bottom, #646060, #262626); } -.openerp .oe_topbar .oe_systray { - float: right; -} -.openerp .oe_topbar .oe_systray > div { - float: left; - padding: 0 4px 0 4px; -} .openerp .oe_topbar .oe_topbar_item li { float: left; } @@ -596,6 +589,69 @@ -webkit-box-shadow: none; -box-shadow: none; } +.openerp .oe_systray > div { + float: left; + padding: 0 4px 0 4px; +} +.openerp .oe_systray { + float: right; +} +.openerp .oe_systray .oe_systray_dropdown { + position: relative; +} +.openerp .oe_systray .oe_systray_dropdown:hover .oe_systray_dropdown_options { + display: block; +} +.openerp .oe_systray .oe_systray_dropdown_options { + background: #333333; + background: rgba(37, 37, 37, 0.9); + display: none; + position: absolute; + z-index: 900; + border: 0; + margin-left: 0; + margin-right: 0; + padding: 6px 0; + zoom: 1; + border-color: #999999; + border-color: rgba(0, 0, 0, 0.2); + border-style: solid; + border-width: 0 1px 1px; + -moz-border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.openerp .oe_systray .oe_systray_dropdown_options li { + float: none; + display: block; + background-color: none; +} +.openerp .oe_systray .oe_systray_dropdown_options li a { + display: block; + padding: 4px 15px; + clear: both; + font-weight: normal; + line-height: 18px; + color: #eeeeee; +} +.openerp .oe_systray .oe_systray_dropdown_options li a:hover { + background-color: #292929; + background-image: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); + background-image: -webkit-linear-gradient(top, #292929, #191919); + background-image: -moz-linear-gradient(top, #292929, #191919); + background-image: -ms-linear-gradient(top, #292929, #191919); + background-image: -o-linear-gradient(top, #292929, #191919); + background-image: linear-gradient(to bottom, #292929, #191919); + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; +} .openerp .oe_menu { float: left; padding: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 447bfc48abf..fb8f85d535c 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -354,12 +354,6 @@ $colour4: #8a89ba border-bottom: solid 1px black @include vertical-gradient(#646060, #262626) - .oe_systray - float: right - .oe_systray > div - float: left - padding: 0 4px 0 4px - .oe_topbar_item li float: left @@ -444,6 +438,7 @@ $colour4: #8a89ba float: left .oe_dropdown position: relative + .oe_dropdown_options float: left background: #333 @@ -480,6 +475,50 @@ $colour4: #8a89ba @include vertical-gradient(#292929, #191919) @include box-shadow(none) // }}} + // Systray {{{ + .oe_systray > div + float: left + padding: 0 4px 0 4px + .oe_systray + float: right + + .oe_systray_dropdown + position: relative + .oe_systray_dropdown:hover .oe_systray_dropdown_options + display: block + .oe_systray_dropdown_options + background: #333 + background: rgba(37,37,37,0.9) + display: none + position: absolute + z-index: 900 + border: 0 + margin-left: 0 + margin-right: 0 + padding: 6px 0 + zoom: 1 + border-color: #999 + border-color: rgba(0, 0, 0, 0.2) + border-style: solid + border-width: 0 1px 1px + @include radius(0 0 6px 6px) + @include box-shadow(0 1px 4px rgba(0,0,0,0.3)) + @include background-clip() + li + float: none + display: block + background-color: none + a + display: block + padding: 4px 15px + clear: both + font-weight: normal + line-height: 18px + color: #eee + &:hover + @include vertical-gradient(#292929, #191919) + @include box-shadow(none) + // }}} // Menu {{{ .oe_menu float: left diff --git a/addons/web/static/src/css/base_old.css b/addons/web/static/src/css/base_old.css index 8f333fae761..74b660f7613 100644 --- a/addons/web/static/src/css/base_old.css +++ b/addons/web/static/src/css/base_old.css @@ -880,60 +880,6 @@ label.error { text-align: left; padding: 4px 5px; } -/* Shortcuts*/ -.oe-shortcut-toggle { - height: 20px; - margin-top: 3px; - padding: 0; - width: 24px; - cursor: pointer; - display: block; - background: url(/web/static/src/img/add-shortcut.png) no-repeat center center; - float: left; -} -.oe-shortcut-remove{ - background: url(/web/static/src/img/remove-shortcut.png) no-repeat center center; -} -.oe-shortcuts { - position: absolute; - margin: 0; - padding: 6px 15px; - top: 37px; - left: 197px; - right: 0; - height: 17px; - line-height: 1.2; -} -.oe-shortcuts ul { - display: block; - overflow: hidden; - list-style: none; - white-space: nowrap; - padding: 0; - margin: 0; -} -.oe-shortcuts li { - cursor: pointer; - display: -moz-inline-stack; - display: inline-block; - display: inline; /*IE7 */ - color: #fff; - text-align: center; - border-left: 1px solid #909090; - padding: 0 4px; - font-size: 80%; - font-weight: normal; - vertical-align: top; -} - -.oe-shortcuts li:hover { - background-color: #666; -} -.oe-shortcuts li:first-child { - border-left: none; - padding-left: 0; -} - ul.oe-arrow-list { padding-left: 1.1em; margin: 0; diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index f43da0431ff..069ce1ad110 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -751,59 +751,12 @@ instance.web.UserMenu = instance.web.Widget.extend({ self.$element.find('.oe_topbar_name').text(topbar_name); var avatar_src = _.str.sprintf('%s/web/binary/image?session_id=%s&model=res.users&field=avatar&id=%s', self.session.prefix, self.session.session_id, self.session.uid); $avatar.attr('src', avatar_src); - return self.shortcut_load(); }); }; this.update_promise = this.update_promise.pipe(fct, fct); }, on_action: function() { }, - shortcut_load :function(){ - var self = this, - sc = self.session.shortcuts, - shortcuts_ds = new instance.web.DataSet(this, 'ir.ui.view_sc'); - self.$element.find('.oe_dropdown_options a[data-menu=shortcut]').each(function() { - $(this).parent().remove(); - }); - // TODO: better way to communicate between sections. - // sc.bindings, because jquery does not bind/trigger on arrays... - if (!sc.binding) { - sc.binding = {}; - $(sc.binding).bind({ - 'add': function (e, attrs) { - shortcuts_ds.create(attrs, function (out) { - var shortcut = QWeb.render('UserMenu.shortcut', { - shortcuts : [{ - name : attrs.name, - id : out.result, - res_id : attrs.res_id - }] - }); - $(shortcut).appendTo(self.$element.find('.oe_dropdown_options')); - attrs.id = out.result; - sc.push(attrs); - }); - }, - 'remove-current': function () { - var menu_id = self.session.active_id; - var $shortcut = self.$element.find('.oe_dropdown_options li a[data-id=' + menu_id + ']'); - var shortcut_id = $shortcut.data('shortcut-id'); - $shortcut.remove(); - shortcuts_ds.unlink([shortcut_id]); - var sc_new = _.reject(sc, function(shortcut){ return shortcut_id === shortcut.id}); - sc.splice(0, sc.length); - sc.push.apply(sc, sc_new); - } - }); - } - return this.rpc('/web/session/sc_list', {}, function(shortcuts) { - sc.splice(0, sc.length); - sc.push.apply(sc, shortcuts); - - $(QWeb.render('UserMenu.shortcut', {'shortcuts': shortcuts})) - .appendTo(self.$element.find('.oe_dropdown_options')); - }); - }, on_menu_logout: function() { }, on_menu_settings: function() { @@ -860,16 +813,6 @@ instance.web.UserMenu = instance.web.Widget.extend({ modal: true, width: 960, title: _t("About")}); }); }, - on_menu_shortcut: function($link) { - var self = this, - id = $link.data('id'); - self.session.active_id = id; - self.rpc('/web/menu/action', {'menu_id': id}, function(ir_menu_data) { - if (ir_menu_data.action.length){ - self.on_action(ir_menu_data.action[0][2]); - } - }); - } }); instance.web.WebClient = instance.web.Widget.extend({ diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index e633ea9cfec..00fdb9aec98 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -69,7 +69,6 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess self.module_loaded[mod] = true; }); this.context = {}; - this.shortcuts = []; this.active_id = null; return this.session_init(); }, diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 798c5bb1493..298967ab8e8 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -636,8 +636,6 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ var self = this; return $.when(this._super(view_type, no_store)).then(function () { - self.shortcut_check(self.views[view_type]); - var controller = self.views[self.active_view].controller, fvg = controller.fields_view, view_id = (fvg && fvg.view_id) || '--'; @@ -681,44 +679,6 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ self.views[self.active_view].controller.do_load_state(state, warm); }); }, - shortcut_check : function(view) { - var self = this; - var grandparent = this.getParent() && this.getParent().getParent(); - // display shortcuts if on the first view for the action - var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle'); - if (!this.action.name || - !(view.view_type === this.views_src[0].view_type - && view.view_id === this.views_src[0].view_id)) { - $shortcut_toggle.hide(); - return; - } - $shortcut_toggle.removeClass('oe-shortcut-remove').show(); - if (_(this.session.shortcuts).detect(function (shortcut) { - return shortcut.res_id === self.session.active_id; })) { - $shortcut_toggle.addClass("oe-shortcut-remove"); - } - this.shortcut_add_remove(); - }, - shortcut_add_remove: function() { - var self = this; - var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle'); - $shortcut_toggle - .unbind("click") - .click(function() { - if ($shortcut_toggle.hasClass("oe-shortcut-remove")) { - $(self.session.shortcuts.binding).trigger('remove-current'); - $shortcut_toggle.removeClass("oe-shortcut-remove"); - } else { - $(self.session.shortcuts.binding).trigger('add', { - 'user_id': self.session.uid, - 'res_id': self.session.active_id, - 'resource': 'ir.ui.menu', - 'name': self.action.name - }); - $shortcut_toggle.addClass("oe-shortcut-remove"); - } - }); - }, display_title: function () { return this.action.name; } diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 84179ea0042..ea1eb831e24 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -351,18 +351,10 @@
  • Log out

  • About OpenERP
  • -

  • - -
  • - - - -
  • -
    Activate the developper mode @@ -441,10 +433,6 @@
    - - -