Skip to content

Commit

Permalink
fix(flicking): Fix panel move by API Android 2.x
Browse files Browse the repository at this point in the history
The container element should have left css prop values as '0px',
but in the case of non-touch by user it was dismissed by condition.
Removing hammer event check condition fix the problem.

Ref naver#485
Close naver#323
  • Loading branch information
박재성[AjaxUI][FE플랫폼] authored and GitHub Enterprise committed Apr 12, 2017
1 parent 4cebad4 commit 2a187f0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/flicking.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ eg.module("flicking", ["jQuery", eg, window, document, eg.MovableCoord], functio

panel.animating = true;

if (!customEvent.restoreCall && e.hammerEvent &&
if (!customEvent.restoreCall &&
this._setPhaseValue("start", {
depaPos: e.depaPos,
destPos: e.destPos
Expand Down
38 changes: 38 additions & 0 deletions test/unit/js/flicking.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,44 @@ QUnit.test("Workaround for buggy link highlighting on android 2.x", function(ass
assert.ok(leftValue && parseInt(leftValue, 10) > 0, "Panel should be moved using left property instead of translate.");
});

QUnit.test("Android 2.x panel move by API", function(assert) {
var done = assert.async();

// Given
eg.hook.agent = function () {
return {
// GalaxyS:2.3.4
"device": "GalaxyS:2.3.4",
"ua": "Mozilla/5.0 (Linux;U;Android 2.3.4;ko-kr;SHW-M110S Build/GINGERBREAD)AppleWebKit/533.1(KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
"os": {
"name": "android",
"version": "2.3.4"
},
"browser": {
"name": "default",
"version": "-1"
},
"isHWAccelerable": false,
"isTransitional": false,
"_hasClickBug": false
};
};
eg.invoke("flicking",[null, eg]);

// When
var inst = this.create("#mflick1");
var $container = inst.$container;

inst.next(300);

assert.equal($container.css("left"), "0px", "During the panel move, container's left should be 0px.");

setTimeout(function() {
assert.notEqual($container.css("left"), "0px", "After panel move container's left shouldn't be 0px.");
done();
}, 500);
});

QUnit.test("Check public methods return", function (assert) {
var inst = this.create("#mflick1", { circular: true });
var instances = [
Expand Down

0 comments on commit 2a187f0

Please sign in to comment.