Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. From 165d081550891c4115ae65927763879aa23a0fa7 Mon Sep 17 00:00:00 2001
  2. From: Roman Dzvinkovsky <romand.ne@gmail.com>
  3. Date: Thu, 18 Dec 2014 20:22:34 -0300
  4. Subject: [PATCH] cleanup
  5.  
  6. ---
  7. public/js/vmwidget/report.js | 12 +++++-------
  8. 1 file changed, 5 insertions(+), 7 deletions(-)
  9.  
  10. diff --git a/public/js/vmwidget/report.js b/public/js/vmwidget/report.js
  11. index 9966f65..a1da992 100644
  12. --- a/public/js/vmwidget/report.js
  13. +++ b/public/js/vmwidget/report.js
  14. @@ -6,7 +6,7 @@ $.widget('report.pages', $.vmwidget.array, {
  15. _create: function() {
  16. this._super();
  17.  
  18. - var $menu = $('<div>').addClass('vm-new-page-menu');
  19. + var $menu = $('<div>').addClass('vm-new-page-menu').css('max-height', 0);
  20. _.each(this.options.items.anyOf, function(item, i) {
  21. $('<div>')
  22. .attr('class', 'vm-page-item')
  23. @@ -19,12 +19,11 @@ $.widget('report.pages', $.vmwidget.array, {
  24. 'click div.vm-add-page': function(e) {
  25. this.removeMenu();
  26.  
  27. - this._$menu = $menu.clone().css('max-height', 0)
  28. - .insertAfter(e.currentTarget);
  29. + this._$menu = $menu.clone().insertAfter(e.currentTarget);
  30.  
  31. - window.getComputedStyle(this._$menu[0]).height;
  32. + window.getComputedStyle(this._$menu[0]);
  33.  
  34. - this._$menu.css('max-height', '1500px').menu({items: 'div'});
  35. + this._$menu.css('max-height', '3000px').menu({items: 'div'});
  36.  
  37. var that = this;
  38. $(document).one('click', function() { that.removeMenu(); });
  39. @@ -35,13 +34,12 @@ $.widget('report.pages', $.vmwidget.array, {
  40. var $item = $(e.currentTarget),
  41. schema = this.options.items.anyOf[$item.data('page')];
  42.  
  43. - if (this._$menu) this._$menu.hide();
  44. + this.removeMenu();
  45.  
  46. $('<div>')
  47. .insertAfter($item.parent().parent())
  48. .create_vmwidget({allOf: [schema, {page_required: false}]});
  49. this.enumeratePages();
  50. - this.removeMenu();
  51. return false;
  52. },
  53. 'click span.vm-page-delete': function(e) {
  54. --
  55. 2.1.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement