mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
- Extract Browser capabilities from Discourse namespace into a Singleton.
- Change Scrolling slack based on Android / Touch / Desktop
This commit is contained in:
@ -75,34 +75,6 @@ Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
||||
@method bindDOMEvents
|
||||
**/
|
||||
bindDOMEvents: function() {
|
||||
var $html, hasTouch;
|
||||
|
||||
$html = $('html');
|
||||
hasTouch = false;
|
||||
|
||||
if ($html.hasClass('touch')) {
|
||||
hasTouch = true;
|
||||
}
|
||||
|
||||
if (Modernizr.prefixed("MaxTouchPoints", navigator) > 1) {
|
||||
hasTouch = true;
|
||||
}
|
||||
|
||||
if (hasTouch) {
|
||||
$html.addClass('discourse-touch');
|
||||
this.touch = true;
|
||||
this.hasTouch = true;
|
||||
} else {
|
||||
$html.addClass('discourse-no-touch');
|
||||
this.touch = false;
|
||||
}
|
||||
|
||||
$('#main').on('click.discourse', '[data-not-implemented=true]', function(e) {
|
||||
e.preventDefault();
|
||||
alert(I18n.t('not_implemented'));
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#main').on('click.discourse', 'a', function(e) {
|
||||
if (e.isDefaultPrevented() || e.shiftKey || e.metaKey || e.ctrlKey) { return; }
|
||||
|
||||
|
Reference in New Issue
Block a user