Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 279460 | Differences between
and this patch

Collapse All | Expand All

(-)source/class/qx/html/Scroll.js (+46 lines)
Lines 75-80 Link Here
75
      }
75
      }
76
76
77
      return sum;
77
      return sum;
78
    },
79
80
81
    /**
82
     * Disables browser-native scrolling
83
     *
84
     * @type static
85
     * @param el {Element} html-element
86
     * @return {void}
87
     */
88
    disableScrolling : function(el) 
89
    {
90
      this.enableScrolling(el);
91
      el.scrollLeft = 0;
92
      el.scrollTop = 0;
93
      qx.html.EventRegistration.addEventListener(el, "scroll", this._onscroll);
94
    },
95
96
97
    /**
98
     * Re-enables browser-native scrolling
99
     *
100
     * @type static
101
     * @param el {Element} html-element
102
     * @return {void}
103
     */
104
    enableScrolling : function(el) 
105
    {;
106
      qx.html.EventRegistration.removeEventListener(el, "scroll", this._onscroll);
107
    },
108
109
110
    /**
111
     * Handler for the scroll-event
112
     *
113
     * @type static
114
     * @param ev {event} scroll-event
115
     * @return {void}
116
     */    
117
    _onscroll : function(ev) 
118
    {
119
      var el = ev.target || ev.srcElement;
120
      if(ev.scrollLeft != 0 || ev.scrollTop != 0) {
121
        el.scrollLeft = 0;
122
        el.scrollTop = 0;
123
      }
78
    }
124
    }
79
  }
125
  }
80
});
126
});
(-)source/class/qx/ui/core/Widget.js (-1 / +60 lines)
Lines 1210-1216 Link Here
1210
      document.body.removeChild(t);
1210
      document.body.removeChild(t);
1211
    },
1211
    },
1212
1212
1213
    _idCounter : 0
1213
    _idCounter : 0,
1214
1215
1216
1217
1218
1219
1220
    /*
1221
    ---------------------------------------------------------------------------
1222
      SCROLL-BLOCKER
1223
    ---------------------------------------------------------------------------
1224
    */
1225
    
1226
    /**
1227
     * Disables browser-native scrolling
1228
     *
1229
     * @type static
1230
     * @param widget {widget} widget to diable scrolling for
1231
     * @return {void}
1232
     */
1233
    disableScrolling : function(widget)
1234
    {
1235
      var el = widget._getTargetNode();
1236
      if(el) {
1237
        qx.html.Scroll.disableScrolling(el);
1238
      } else {
1239
        widget.addEventListener("appear", this._blockScrollingOnAppear, this);
1240
      }
1241
    },
1242
    
1243
    /**
1244
     * Re-enables browser-native scrolling
1245
     *
1246
     * @type static
1247
     * @param widget {widget} widget to re-enable scrolling for
1248
     * @return {void}
1249
     */
1250
    enableScrolling : function(widget)
1251
    {
1252
      var el = widget._getTargetNode();
1253
      if(el) {
1254
        qx.html.Scroll.enableScrolling(el);
1255
      } else {
1256
        widget.removeEventListener("appear", this._blockScrollingOnAppear, this);
1257
      }     
1258
    },
1259
    
1260
    /**
1261
     * Handler needed for the delayed node-creation
1262
     *
1263
     * @type static
1264
     * @param ev {Event} The "appear"-event
1265
     * @return {void}
1266
     */
1267
    _blockScrollingOnAppear : function(ev)
1268
    {
1269
      var widget = ev.getTarget();
1270
      widget.removeEventListener("appear", this._blockScrollingOnAppear, this);
1271
      this.disableScrolling(widget);
1272
    }
1214
1273
1215
  },
1274
  },
1216
1275

Return to bug 279460