Browse Source

AMBARI-7073 Incorrect behavior of adding Dashboard's widgets. (Max Shepel via atkach)

atkach 10 năm trước cách đây
mục cha
commit
60c0d169b9

+ 1 - 1
ambari-web/app/templates/main/dashboard/plus_button_filter.hbs

@@ -23,7 +23,7 @@
         {{#each widget in view.hiddenWidgets}}
           <li>
             <label class="checkbox">
-              {{view Ember.Checkbox checkedBinding="widget.checked"}} {{unbound widget.displayName}}
+              {{view view.widgetCheckbox checkedBinding="widget.checked"}} {{unbound widget.displayName}}
             </label>
           </li>
         {{/each}}

+ 7 - 5
ambari-web/app/views/main/dashboard/widgets.js

@@ -203,11 +203,13 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
       hiddenWidgetsBinding: 'parentView.hiddenWidgets',
       visibleWidgetsBinding: 'parentView.visibleWidgets',
       valueBinding: '',
-      didInsertElement: function() {
-        $(".add-widgets-dropdown-list").click(function( event ) {
-          event.stopPropagation();
-        });
-      },
+      widgetCheckbox: Em.Checkbox.extend({
+        didInsertElement: function() {
+          $('.checkbox').click(function(event) {
+            event.stopPropagation();
+          });
+        }
+      }),
       closeFilter:function () {
       },
       applyFilter:function() {