25 lines
762 B
JavaScript
25 lines
762 B
JavaScript
(function () {
|
|
'use strict';
|
|
|
|
var website = openerp.website;
|
|
website.EditorBar.include({
|
|
events: _.extend({}, website.EditorBar.prototype.events, {
|
|
'click a[data-action=show-mobile-preview]': 'mobilePreview',
|
|
}),
|
|
mobilePreview: function () {
|
|
(new website.MobilePreview()).appendTo($(document.body));
|
|
},
|
|
});
|
|
|
|
website.MobilePreview = openerp.Widget.extend({
|
|
template: 'website.mobile_preview',
|
|
events: {
|
|
'hidden.bs.modal': 'destroy'
|
|
},
|
|
start: function () {
|
|
document.getElementById("mobile-viewport").src = window.location.origin + window.location.pathname + "#mobile-preview";
|
|
this.$el.modal();
|
|
},
|
|
});
|
|
})();
|