Fixing card zoom-in on touchscreens and also allow to scroll the card image in the info dialog using swipes.

This commit is contained in:
marcins78@gmail.com
2011-09-15 00:11:06 +00:00
parent 9d9c2bf92a
commit adaf3a8c41

View File

@@ -223,6 +223,18 @@ var GempLotrGameUI = Class.extend({
height: 300
});
var swipeOptions = {
threshold: 20,
swipeUp: function (event) {
that.infoDialog.prop({ scrollTop: that.infoDialog.prop("scrollHeight") });
return false;
},
swipeDown: function (event) {
that.infoDialog.prop({ scrollTop: 0 });
return false;
}
};
this.infoDialog.swipe(swipeOptions);
},
layoutUI: function(sizeNotChanged) {
@@ -716,9 +728,12 @@ var GempLotrGameUI = Class.extend({
threshold: 20,
swipeUp: function (event) {
var tar = $(event.target);
if (tar.hasClass("borderOverlay")) {
var selectedCardElem = tar.parent();
that.displayCardInfo(selectedCardElem.data("card"));
if (tar.hasClass("actionArea")) {
tar = tar.parent();
if (tar.hasClass("borderOverlay")) {
var selectedCardElem = tar.parent();
that.displayCardInfo(selectedCardElem.data("card"));
}
}
return false;
}