Skip to content

Commit

Permalink
Merge pull request #266 from be-fe/2.X
Browse files Browse the repository at this point in the history
2.0.1 upgrade
  • Loading branch information
xieyu33333 committed Oct 20, 2015
2 parents 6fb753e + 02ed032 commit 6875927
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 19 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ To learn more advanced features, please refer to [WIKI](https://github.com/BE-FE
</td>
</tr>
<tr>
<td>type (Soon abandoned or renamed)</td>
<td>type (obsolete)</td>
<td>-</td>
<td>-</td>
</tr>
Expand Down Expand Up @@ -256,6 +256,11 @@ To learn more advanced features, please refer to [WIKI](https://github.com/BE-FE
<td>{number}</td>
<td>Specifies an index as the default home scene</td>
</tr>
<tr>
<td>fixPage</td>
<td>{boolean}</td>
<td>Whether to disable native scrolling and rebound effect. Default: true (enable)</td>
</tr>
<tr>
<td>plugins</td>
<td>{array}</td>
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
".idea",
"test"
],
"version": "2.0.0"
"version": "2.0.1"
}
2 changes: 1 addition & 1 deletion build/iSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
* @type {boolean}
* @public
*/
this.fixPage = opts.fixPage || true;
this.fixPage = opts.fixPage === undefined ? true : opts.fixPage;

/**
* slideIndex
Expand Down
2 changes: 1 addition & 1 deletion build/iSlider.min.js

Large diffs are not rendered by default.

27 changes: 25 additions & 2 deletions build/iSlider.plugin.dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
* @author BE-FE Team
* xieyu33333 [email protected]
* shinate [email protected]
* @Instructions
* activation:
* new iSlider({
* ...
* plugins: ['dot']
* ...
* });
* more options:
* new iSlider({
* ...
* plugins: [['dot', {locate:'absoulute'}]]
* ...
* });
* @options
* locate {string|HTML Element} the warpper of dots value: 'absolute', 'relative' or Specified dom, default: 'absolute'
*/

(function (global, factory) {
Expand All @@ -24,9 +39,17 @@

'use strict';

iSlider && iSlider.regPlugin('dot', function () {
iSlider && iSlider.regPlugin('dot', function (opts) {
var HANDLE = this;
if (!HANDLE.isVertical) {
var locate = (function (locate) {
if (locate === 'relative') {
return HANDLE.wrap;
} else if (Boolean(locate.nodeName) && Boolean(locate.nodeType)) {
return locate;
}
return HANDLE.wrap.parentNode;
})(opts && opts.locate != null ? opts.locate : false);
var data = HANDLE.data;
var dots = [];
var dotWrap = document.createElement('ul');
Expand All @@ -52,7 +75,7 @@

renderDots();

HANDLE.wrap.parentNode.appendChild(dotWrap);
locate.appendChild(dotWrap);

HANDLE.on('slideChange', function () {
if (!HANDLE.isVertical) {
Expand Down
2 changes: 1 addition & 1 deletion build/iSlider.plugin.dot.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions change_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
### iSlider 2.0.1

2015-10-20

#### bug fixes

- fixPage default value

#### Something new

- [Plug-ins] dot support more optisons,
- locate - In which the container, values: 'absolute' or 'relative' or DOM, default is 'absolute'
- absolute: Same with iSlider
- relative: In iSlider
- Specified dom, eg: document.getElementById('xxx')


### iSlider 2.0

2015-08-29
Expand Down
2 changes: 1 addition & 1 deletion demo/public/js/iSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
* @type {boolean}
* @public
*/
this.fixPage = opts.fixPage || true;
this.fixPage = opts.fixPage === undefined ? true : opts.fixPage;

/**
* slideIndex
Expand Down
27 changes: 25 additions & 2 deletions demo/public/js/iSlider.plugin.dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
* @author BE-FE Team
* xieyu33333 [email protected]
* shinate [email protected]
* @Instructions
* activation:
* new iSlider({
* ...
* plugins: ['dot']
* ...
* });
* more options:
* new iSlider({
* ...
* plugins: [['dot', {locate:'absoulute'}]]
* ...
* });
* @options
* locate {string|HTML Element} the warpper of dots value: 'absolute', 'relative' or Specified dom, default: 'absolute'
*/

(function (global, factory) {
Expand All @@ -24,9 +39,17 @@

'use strict';

iSlider && iSlider.regPlugin('dot', function () {
iSlider && iSlider.regPlugin('dot', function (opts) {
var HANDLE = this;
if (!HANDLE.isVertical) {
var locate = (function (locate) {
if (locate === 'relative') {
return HANDLE.wrap;
} else if (Boolean(locate.nodeName) && Boolean(locate.nodeType)) {
return locate;
}
return HANDLE.wrap.parentNode;
})(opts && opts.locate != null ? opts.locate : false);
var data = HANDLE.data;
var dots = [];
var dotWrap = document.createElement('ul');
Expand All @@ -52,7 +75,7 @@

renderDots();

HANDLE.wrap.parentNode.appendChild(dotWrap);
locate.appendChild(dotWrap);

HANDLE.on('slideChange', function () {
if (!HANDLE.isVertical) {
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"name": "iSlider",
"version": "2.0.0",
"author": "qbatyqi",
"version": "2.0.1",
"author": "EUX team",
"main": "build/iSlider.min.js",
"description": "Smooth mobile touch slider for Mobile WebApp, HTML5 App, Hybrid App",
"devDependencies": {
"amdclean": "~2.4.0",
"gulp": "~3.8.9",
"gulp-clean": "^0.3.1",
"gulp-connect": "~2.2.0",
"gulp-cssmin": "^0.1.7",
"gulp-rename": "x",
"gulp-uglify": "~1.0.1",
"requirejs": "x"
"gulp-uglify": "~1.0.1"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
// isLoading: true,
// isAutoplay: true,
// duration: 5000,
plugins: ['dot', 'button', ['zoompic', {zoomFactor: 2}]],
plugins: [['dot', {locate:'relative'}], 'button', ['zoompic', {zoomFactor: 2}]],
onslide: function () {
console.debug(arguments)
},
Expand Down
2 changes: 1 addition & 1 deletion src/js/iSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
* @type {boolean}
* @public
*/
this.fixPage = opts.fixPage || true;
this.fixPage = opts.fixPage === undefined ? true : opts.fixPage;

/**
* slideIndex
Expand Down
27 changes: 25 additions & 2 deletions src/js/plugins/dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
* @author BE-FE Team
* xieyu33333 [email protected]
* shinate [email protected]
* @Instructions
* activation:
* new iSlider({
* ...
* plugins: ['dot']
* ...
* });
* more options:
* new iSlider({
* ...
* plugins: [['dot', {locate:'absoulute'}]]
* ...
* });
* @options
* locate {string|HTML Element} the warpper of dots value: 'absolute', 'relative' or Specified dom, default: 'absolute'
*/

(function (global, factory) {
Expand All @@ -24,9 +39,17 @@

'use strict';

iSlider && iSlider.regPlugin('dot', function () {
iSlider && iSlider.regPlugin('dot', function (opts) {
var HANDLE = this;
if (!HANDLE.isVertical) {
var locate = (function (locate) {
if (locate === 'relative') {
return HANDLE.wrap;
} else if (Boolean(locate.nodeName) && Boolean(locate.nodeType)) {
return locate;
}
return HANDLE.wrap.parentNode;
})(opts && opts.locate != null ? opts.locate : false);
var data = HANDLE.data;
var dots = [];
var dotWrap = document.createElement('ul');
Expand All @@ -52,7 +75,7 @@

renderDots();

HANDLE.wrap.parentNode.appendChild(dotWrap);
locate.appendChild(dotWrap);

HANDLE.on('slideChange', function () {
if (!HANDLE.isVertical) {
Expand Down

0 comments on commit 6875927

Please sign in to comment.