File: JqEltsIterator.hx

package info (click to toggle)
haxe 1%3A3.4.7-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 29,888 kB
  • sloc: ml: 106,129; ansic: 1,978; makefile: 609; cpp: 357; java: 349; cs: 323; python: 250; sh: 75; objc: 64; xml: 29
file content (21 lines) | stat: -rw-r--r-- 476 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package js.jquery;

class JqEltsIterator {
	var j:JQuery;
	var i:Int;
	inline public function new(j:JQuery):Void {
		this.i = 0;
		this.j = j;
	}
	inline public function hasNext():Bool {
		return i < j.length;
	}
	inline public function next():JQuery {
		return new JQuery(this.j[i++]);
	}

	static function __init__() {
		if (untyped __typeof__(JQuery) != "undefined" && JQuery.fn != null)
			JQuery.fn.elements = function() return new JqEltsIterator(js.Lib.nativeThis);
	}
}