Commits

Shlomi Fish committed 326c422

Extract a common .forEach.

  • Participants
  • Parent commits 394383a

Comments (0)

Files changed (1)

File fc-solve/site/wml/src/js/web-fc-solve-ui.js

             },
         },
         methods: {
+            _each_control: function(cb) {
+                var that = this;
+
+                that.bookmark_controls.forEach(cb);
+            },
             on_bookmarking: function() {
                 var that = this;
 
 
                 var control_values = {};
 
-                that.bookmark_controls.forEach(function (myid) {
+                that._each_control(function (myid) {
                     control_values[myid] = get_v(myid);
                 });
 
                 // Remove trailing 1.
                 var params = $.querystring(qs.substr(1));
 
-                that.bookmark_controls.forEach(function (myid) {
+                that._each_control(function (myid) {
                     var ctl = $('#' + myid);
                     if (ctl.is(':checkbox')) {
                         ctl.prop('checked', ((params[myid] == "1") ? true : false));