File tree Expand file tree Collapse file tree 2 files changed +14
-22
lines changed Expand file tree Collapse file tree 2 files changed +14
-22
lines changed Original file line number Diff line number Diff line change 1
- class Element
2
- %x{
3
- var root = $opal.global, dom_class;
4
-
5
- if (root.jQuery) {
6
- dom_class = jQuery
7
- }
8
- else if (root.Zepto) {
9
- dom_class = Zepto.zepto.Z;
10
- }
11
- else {
12
- throw new Error("jQuery must be included before opal-jquery");
13
- }
1
+ %x{
2
+ var root = $opal.global, dom_class;
14
3
15
- self._proto = dom_class.prototype, def = self._proto;
16
- dom_class.prototype._klass = self;
4
+ if (root.jQuery) {
5
+ dom_class = jQuery
6
+ }
7
+ else if (root.Zepto) {
8
+ dom_class = Zepto.zepto.Z;
9
+ }
10
+ else {
11
+ throw new Error("jQuery must be included before opal-jquery");
17
12
}
18
13
19
- include Kernel
14
+ Opal.bridge_class('Element', dom_class);
15
+ }
16
+
17
+ class Element
20
18
include Enumerable
21
19
22
20
def self . find ( selector )
Original file line number Diff line number Diff line change 1
1
require 'opal-rspec'
2
2
require 'opal-jquery'
3
3
4
- # FIXME: wtf? why isnt Element getting should and should_not
5
- class Element
6
- `def.$should = $opal.top.$should`
7
- `def.$should_not = $opal.top.$should_not`
8
- end
9
-
10
4
module JqueryHelpers
11
5
# Add some html code to the body tag ready for testing. This will
12
6
# be added before each test, then removed after each test. It is
You can’t perform that action at this time.
0 commit comments