Vladimir Bykov 11 лет назад
Родитель
Сommit
5780c75538
2 измененных файлов с 14 добавлено и 11 удалено
  1. 1 1
      apps/web/priv/static/app/js/dragndrop.js
  2. 13 10
      apps/web/priv/static/app/js/okey/deck.js

+ 1 - 1
apps/web/priv/static/app/js/dragndrop.js

@@ -68,7 +68,7 @@ function DragScope(scope) {
             this.trf = this.$el.attr("transform"), this.trf && (this.trf = this.trf.slice(10, -1).split(/\s+/)), 
             this.trf = this.$el.attr("transform"), this.trf && (this.trf = this.trf.slice(10, -1).split(/\s+/)), 
             this.storeTrf(), silent || (document.createTouch || isIE ? (this.$el.on("touchmove", this.onMove), 
             this.storeTrf(), silent || (document.createTouch || isIE ? (this.$el.on("touchmove", this.onMove), 
             this.$el.on("touchend", this.onUp)) : ($("body").on("mousemove", this.onMove), $("body").on("mouseup", this.onUp)), 
             this.$el.on("touchend", this.onUp)) : ($("body").on("mousemove", this.onMove), $("body").on("mouseup", this.onUp)), 
-            this.$el.trigger("dragstart")));
+            this.$el.trigger("dragstart", {detail: {target:this}})));
         },
         },
 
 
         onMove: function(e, silent) {
         onMove: function(e, silent) {

+ 13 - 10
apps/web/priv/static/app/js/okey/deck.js

@@ -213,16 +213,19 @@ function DeckScope(scope) {
         },
         },
 
 
         select: function(e) {
         select: function(e) {
-            selected = null, this.each(function(card) {
-                if(card && card.$el[0] == e.target){
-                    selected = card
-                    this.restoredCards = this.cards.map(function (row){ return row.concat() })
-                    return !1 
-                }
-                else {
-                    return !0
-                }
-            });
+            selected = null;
+            selected = e.detail.target.owner
+            this.restoredCards = this.cards.map(function (row){ return row.concat() })
+            // this.each(function(card) {
+            //     if(card && card.$el[0] == e.target){
+            //         selected = card
+            //         this.restoredCards = this.cards.map(function (row){ return row.concat() })
+            //         return !1 
+            //     }
+            //     else {
+            //         return !0
+            //     }
+            // });
         },
         },
 
 
         place: function(target, x, y) {
         place: function(target, x, y) {