[IMP] bootstrapifying topbar
bzr revid: fp@tinyerp.com-20130811103514-l2enykdzxk3ov4wz
This commit is contained in:
commit
a40abac6cb
|
@ -30,15 +30,17 @@ instance.website.EditorBar = instance.web.Widget.extend({
|
|||
start: function() {
|
||||
var self = this;
|
||||
|
||||
this.$('button[data-action]').prop('disabled', true)
|
||||
.parent().hide();
|
||||
this.$('#website-top-edit').hide();
|
||||
this.$('#website-top-view').show();
|
||||
|
||||
$('.dropdown-toggle').dropdown();
|
||||
|
||||
this.$buttons = {
|
||||
edit: this.$('button[data-action=edit]'),
|
||||
save: this.$('button[data-action=save]'),
|
||||
cancel: this.$('button[data-action=cancel]'),
|
||||
snippet: this.$('button[data-action=snippet]'),
|
||||
};
|
||||
this.$buttons.edit.prop('disabled', false).parent().show();
|
||||
|
||||
self.snippet_start();
|
||||
|
||||
|
@ -51,10 +53,14 @@ instance.website.EditorBar = instance.web.Widget.extend({
|
|||
);
|
||||
},
|
||||
edit: function () {
|
||||
this.$buttons.edit.prop('disabled', true).parent().hide();
|
||||
this.$buttons.cancel.add(this.$buttons.snippet).prop('disabled', false)
|
||||
.add(this.$buttons.save)
|
||||
.parent().show();
|
||||
this.$buttons.edit.prop('disabled', true);
|
||||
this.$('#website-top-view').hide();
|
||||
this.$('#website-top-edit').show();
|
||||
|
||||
// this.$buttons.cancel.add(this.$buttons.snippet).prop('disabled', false)
|
||||
// .add(this.$buttons.save)
|
||||
// .parent().show();
|
||||
//
|
||||
// TODO: span edition changing edition state (save button)
|
||||
var $editables = $('[data-oe-model]')
|
||||
.not('link, script')
|
||||
|
|
|
@ -14,6 +14,6 @@ $(function() {
|
|||
$(function() {
|
||||
var editor = new instance.website.EditorBar(instance.webclient);
|
||||
editor.prependTo($('body'));
|
||||
$('body').css('padding-top', '32px'); // Not working properly: editor.$el.outerHeight());
|
||||
$('body').css('padding-top', '50px'); // Not working properly: editor.$el.outerHeight());
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,12 +3,42 @@
|
|||
-->
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="Website.EditorBar">
|
||||
<ul class="oe_website_editorbar openerp">
|
||||
<li><button data-action="edit">Edit</button></li>
|
||||
<li><button data-action="save">Save</button></li>
|
||||
<li><button data-action="cancel">Cancel</button></li>
|
||||
<li class="oe_right"><button data-action="snippet">Building Blocks</button></li>
|
||||
</ul>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner" id="website-top-view">
|
||||
<form class="navbar-form pull-left">
|
||||
<button data-action="edit" class="btn btn-primary">Edit</button>
|
||||
</form>
|
||||
<ul class="nav pull-right">
|
||||
<li><a href="#">Promote<!-- <sup><span class="badge">1</span></sup> --></a></li>
|
||||
<li><a href="#">Translate</a></li>
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Customize <strong class="carret"></strong></a>
|
||||
<div class="dropdown-menu">
|
||||
aaa
|
||||
</div>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Settings <strong class="carret"></strong></a>
|
||||
<div class="dropdown-menu">
|
||||
Install Apps
|
||||
Paramters
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="navbar-inner" id="website-top-edit">
|
||||
<form class="navbar-form pull-left">
|
||||
<button data-action="save" class="btn btn-primary">Save</button>
|
||||
<button data-action="cancel" class="btn">Cancel</button>
|
||||
</form>
|
||||
<ul class="nav pull-right">
|
||||
<li><button data-action="snippet" class="btn btn-primary">Building Blocks</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</t>
|
||||
<t t-name="Website.ActionGroup">
|
||||
<div class="dropdown">
|
||||
|
|
Loading…
Reference in New Issue