API Reference 0.3.24dart_web_toolkit_eventDragSupportDetector

DragSupportDetector class

Detector for browser support of drag events.

class DragSupportDetector {

 bool _isSupported;

 /**
  * Using a run-time check, return true if drag events are supported.
  *
  * @return true if supported, false otherwise.
  */
 bool get isSupported => _isSupported;

 DragSupportDetector() {
   _isSupported = detectDragSupport();
 }
 
 bool detectDragSupport() {
   dart_html.DivElement elem = new dart_html.DivElement();
   try {
     elem.onDragStart.listen((dart_html.Event evt){
       return;
     });
   } on Exception catch(e) {
     return false;
   }
   return true;//(typeof elem.ondragstart) == "function";
 }
}

Subclasses

DragSupportDetectorNo

Constructors

new DragSupportDetector() #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
DragSupportDetector() {
 _isSupported = detectDragSupport();
}

Properties

final bool isSupported #

Using a run-time check, return true if drag events are supported.

@return true if supported, false otherwise.

bool get isSupported => _isSupported;

Methods

bool detectDragSupport() #

bool detectDragSupport() {
 dart_html.DivElement elem = new dart_html.DivElement();
 try {
   elem.onDragStart.listen((dart_html.Event evt){
     return;
   });
 } on Exception catch(e) {
   return false;
 }
 return true;//(typeof elem.ondragstart) == "function";
}