Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 165d081550891c4115ae65927763879aa23a0fa7 Mon Sep 17 00:00:00 2001
- From: Roman Dzvinkovsky <romand.ne@gmail.com>
- Date: Thu, 18 Dec 2014 20:22:34 -0300
- Subject: [PATCH] cleanup
- ---
- public/js/vmwidget/report.js | 12 +++++-------
- 1 file changed, 5 insertions(+), 7 deletions(-)
- diff --git a/public/js/vmwidget/report.js b/public/js/vmwidget/report.js
- index 9966f65..a1da992 100644
- --- a/public/js/vmwidget/report.js
- +++ b/public/js/vmwidget/report.js
- @@ -6,7 +6,7 @@ $.widget('report.pages', $.vmwidget.array, {
- _create: function() {
- this._super();
- - var $menu = $('<div>').addClass('vm-new-page-menu');
- + var $menu = $('<div>').addClass('vm-new-page-menu').css('max-height', 0);
- _.each(this.options.items.anyOf, function(item, i) {
- $('<div>')
- .attr('class', 'vm-page-item')
- @@ -19,12 +19,11 @@ $.widget('report.pages', $.vmwidget.array, {
- 'click div.vm-add-page': function(e) {
- this.removeMenu();
- - this._$menu = $menu.clone().css('max-height', 0)
- - .insertAfter(e.currentTarget);
- + this._$menu = $menu.clone().insertAfter(e.currentTarget);
- - window.getComputedStyle(this._$menu[0]).height;
- + window.getComputedStyle(this._$menu[0]);
- - this._$menu.css('max-height', '1500px').menu({items: 'div'});
- + this._$menu.css('max-height', '3000px').menu({items: 'div'});
- var that = this;
- $(document).one('click', function() { that.removeMenu(); });
- @@ -35,13 +34,12 @@ $.widget('report.pages', $.vmwidget.array, {
- var $item = $(e.currentTarget),
- schema = this.options.items.anyOf[$item.data('page')];
- - if (this._$menu) this._$menu.hide();
- + this.removeMenu();
- $('<div>')
- .insertAfter($item.parent().parent())
- .create_vmwidget({allOf: [schema, {page_required: false}]});
- this.enumeratePages();
- - this.removeMenu();
- return false;
- },
- 'click span.vm-page-delete': function(e) {
- --
- 2.1.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement