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
Changed condition on executing ._adjustContainerCss(), which is for Android 2.x environment

Ref #485
Close #325
  • Loading branch information
박재성[AjaxUI][FE플랫폼] authored and GitHub Enterprise committed Apr 12, 2017
1 parent 808735a commit d0a2169
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 @@ -937,7 +937,7 @@ eg.module("flicking", ["jQuery", eg, window, document, eg.MovableCoord], functio
panel.changed && this._triggerEvent(EVENTS.flickEnd);
}

!(phase === "start" && pos === undefined) && this._adjustContainerCss(phase);
this._adjustContainerCss(phase);
},

/**
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 d0a2169

Please # to comment.