Commit 6d22b1ba authored by Rurik Bugdanov's avatar Rurik Bugdanov
Browse files

enable picking on window.mousedown for sliding_sphere

parent 1443208a
Loading
Loading
Loading
Loading
+12 −1
Original line number Original line Diff line number Diff line
@@ -950,7 +950,18 @@ X3DOMObject.PointerMarker.prototype._registerEvents = function(){
    var self = this;
    var self = this;
    var Camera = Map.marker;
    var Camera = Map.marker;


    self._shape.on("click",function(e){
    // PointerMarker MouseEvent are not triggered when isPickable is false
    $(window).on('mousedown',function(e){
        self._shape.attr('isPickable',true);
    });

    $(window).on('mouseup',function(){
      self._shape.attr('isPickable',false);
    });

    // window mousedown above is run after x3dom mousedown handler
    // so we must listen to x3dom 'mouseup' instead of 'click' below
    self._shape.on("mouseup",function(e){
        
        
        X3DOMObject.Marker.dehighlight(self._elem);
        X3DOMObject.Marker.dehighlight(self._elem);