[IMP] Seperate menu tips from action view manager's content

bzr revid: fme@openerp.com-20111130131154-cu9hrcxyjvw15wnc
This commit is contained in:
Fabien Meghazi
2011-11-30 14:11:54 +01:00
parent 4ceed8ea6b
commit b552ff1991
2 changed files with 21 additions and 13 deletions
+3 -3
View File
@@ -426,8 +426,8 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
});
if (this.action.help && !this.flags.low_profile) {
var Users = new session.web.DataSet(self, 'res.users'),
header = this.$element.find('.oe-view-manager-header');
header.delegate('blockquote button', 'click', function() {
$tips = this.$element.find('.oe_view_manager_menu_tips');
$tips.delegate('blockquote button', 'click', function() {
var $this = $(this);
//noinspection FallthroughInSwitchStatementJS
switch ($this.attr('name')) {
@@ -444,7 +444,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
if (!(user && user.id === self.session.uid)) {
return;
}
header.find('blockquote').toggle(user.menu_tips);
$tips.find('blockquote').toggle(user.menu_tips);
});
}
}
+18 -10
View File
@@ -418,6 +418,7 @@
</t>
<t t-name="ViewManager">
<table class="view-manager-main-table">
<tbody>
<tr>
<td class="view-manager-main-content">
<div class="oe-view-manager-header">
@@ -443,21 +444,28 @@
</t>
</td>
</tr>
</tbody>
</table>
</t>
<t t-extend="ViewManager" t-name="ViewManagerAction">
<t t-jquery=".view-manager-main-table tbody" t-operation="prepend">
<tr>
<td class="oe_view_manager_menu_tips" colspan="2">
<blockquote t-if="self.action.help and !self.flags.low_profile
and !(self.action.id in self.session.hidden_menutips)">
<p><t t-esc="self.action.help"/></p>
<div>
<button type="button" name="hide">Hide this tip</button>
<button type="button" name="disable">Disable all tips</button>
</div>
</blockquote>
</td>
</tr>
</t>
<t t-jquery=".oe-view-manager-header" t-operation="prepend">
<blockquote t-if="self.action.help and !self.flags.low_profile
and !(self.action.id in self.session.hidden_menutips)">
<p><t t-esc="self.action.help"/></p>
<div>
<button type="button" name="hide">Hide this tip</button>
<button type="button" name="disable">Disable all tips</button>
</div>
</blockquote>
<a class="oe-shortcut-toggle" title="Add / Remove Shortcut..."
href="javascript: void(0)"> </a>
<a class="oe-shortcut-toggle" title="Add / Remove Shortcut..."
href="javascript: void(0)"> </a>
<button t-if="self.session.debug" class="oe_get_xml_view">
View#<span></span>
</button>