瀏覽代碼

Support a hierarchical selector(#21).

NaotoshiFujita 5 年之前
父節點
當前提交
b68caef1a1
共有 6 個文件被更改,包括 1780 次插入1781 次删除
  1. 886 886
      dist/js/splide.esm.js
  2. 886 886
      dist/js/splide.js
  3. 1 1
      dist/js/splide.min.js
  4. 二進制
      dist/js/splide.min.js.gz
  5. 1 1
      package.json
  6. 6 7
      src/js/splide.js

File diff suppressed because it is too large
+ 886 - 886
dist/js/splide.esm.js


File diff suppressed because it is too large
+ 886 - 886
dist/js/splide.js


File diff suppressed because it is too large
+ 1 - 1
dist/js/splide.min.js


二進制
dist/js/splide.min.js.gz


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@splidejs/splide",
-  "version": "2.2.4",
+  "version": "2.2.5",
   "description": "Splide is a lightweight and powerful slider without any dependencies.",
   "author": "Naotoshi Fujita",
   "license": "MIT",

+ 6 - 7
src/js/splide.js

@@ -7,12 +7,11 @@
 
 import Event from './core/event';
 import State from './core/state';
-import { DEFAULTS } from './constants/defaults';
-
 import compose from './core/composer';
 import { error, exist } from './utils/error';
-import { applyStyle, find } from './utils/dom';
+import { applyStyle } from './utils/dom';
 import { merge, each, values } from './utils/object';
+import { DEFAULTS } from './constants/defaults';
 import * as STATES from './constants/states';
 
 
@@ -26,12 +25,12 @@ export default class Splide {
 	 *
 	 * @throws {Error} When the given root element or selector is invalid.
 	 *
-	 * @param {Element|string}  root        - A selector for a root element or an element itself.
-	 * @param {Object}          options     - Optional. Options to change default behaviour.
-	 * @param {Object}          Components  - Optional. Components.
+	 * @param {Element|string}  root       - A selector for a root element or an element itself.
+	 * @param {Object}          options    - Optional. Options to change default behaviour.
+	 * @param {Object}          Components - Optional. Components.
 	 */
 	constructor( root, options = {}, Components = {} ) {
-		this.root = root instanceof Element ? root : find( document, root );
+		this.root = root instanceof Element ? root : document.querySelector( root );
 		exist( this.root, 'An invalid element/selector was given.' );
 
 		this.Components = null;

Some files were not shown because too many files changed in this diff