소스 검색

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. BIN
      dist/js/splide.min.js.gz
  5. 1 1
      package.json
  6. 6 7
      src/js/splide.js

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 886 - 886
dist/js/splide.esm.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 886 - 886
dist/js/splide.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
dist/js/splide.min.js


BIN
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;

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.