core/src/ons/gesture-detector.js
function toggleBehavior(element, props, toggle) {
    if (!props || !element || !element.style) {
      return;
    }

    // set the css properties
    Utils.each(props, function(value, prop) {
      Utils.setPrefixedCss(element, prop, value, toggle);
    });

    var falseFn = toggle && function() {
      return false;
    };

    // also the disable onselectstart
    if (props.userSelect == 'none') {
      element.onselectstart = falseFn;
    }
    // and disable ondragstart
    if (props.userDrag == 'none') {
      element.ondragstart = falseFn;
    }
  }
function toggleBehavior(element, props, toggle) {
    if (!props || !element || !element.style) {
      return;
    }

    // set the css properties
    Utils.each(props, function(value, prop) {
      Utils.setPrefixedCss(element, prop, value, toggle);
    });

    var falseFn = toggle && function() {
      return false;
    };

    // also the disable onselectstart
    if (props.userSelect == 'none') {
      element.onselectstart = falseFn;
    }
    // and disable ondragstart
    if (props.userDrag == 'none') {
      element.ondragstart = falseFn;
    }
  }
function toggleBehavior ( element , props , toggle ) { if ( ! props || ! element || ! element . style ) { return ; } // set the css properties Utils . each ( props , function ( value , prop ) { Utils . setPrefixedCss ( element , prop , value , toggle ) ; } ) ; var falseFn = toggle && function ( ) { return false ; } ; // also the disable onselectstart if ( props . userSelect == 'none' ) { element . onselectstart = falseFn ; } // and disable ondragstart if ( props . userDrag == 'none' ) { element . ondragstart = falseFn ; } }
toggle browser default behavior by setting css properties.
`userSelect='none'` also sets `element.onselectstart` to false
`userDrag='none'` also sets `element.ondragstart` to false

@param {HtmlElement} element
@param {Object} props
@param {Boolean} [toggle=true]
toggle browser default behavior by setting css properties . userSelect = none also sets element . onselectstart to false userDrag = none also sets element . ondragstart to false