line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Weasel::Widgets::Dojo::Select; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
1260
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
510
|
use Weasel::Widgets::HTML::Select; |
|
1
|
|
|
|
|
568392
|
|
|
1
|
|
|
|
|
53
|
|
8
|
1
|
|
|
1
|
|
10
|
use Weasel::WidgetHandlers qw/ register_widget_handler /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
55
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
8
|
use Moose; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
9
|
|
11
|
|
|
|
|
|
|
extends 'Weasel::Widgets::HTML::Select'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
register_widget_handler(__PACKAGE__, 'Dojo', |
14
|
|
|
|
|
|
|
tag_name => 'table', |
15
|
|
|
|
|
|
|
classes => [ 'dijitSelect' ], |
16
|
|
|
|
|
|
|
attributes => { |
17
|
|
|
|
|
|
|
role => 'listbox', |
18
|
|
|
|
|
|
|
}, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _option_popup { |
23
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
24
|
0
|
|
|
|
|
|
my $id = $self->get_attribute('id'); |
25
|
0
|
|
|
|
|
|
my $page = $self->session->page; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my @rv = $page->find_all("//div[\@dijitpopupparent='$id']"); |
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
if (! @rv) { # no elements returned, while we expect one; create the popup |
30
|
|
|
|
|
|
|
# make sure the popup gets created by clicking twice (pop up+pop down) |
31
|
0
|
|
|
|
|
|
$self->click; |
32
|
|
|
|
|
|
|
# wait until the popup has been created! |
33
|
0
|
|
|
|
|
|
$page->find("//div[\@dijitpopupparent='$id']"); |
34
|
0
|
|
|
|
|
|
$self->click; # hide the popup again |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
@rv = $page->find_all("//div[\@dijitpopupparent='$id']"); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
return (shift @rv); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub get_attribute { |
43
|
0
|
|
|
0
|
1
|
|
my ($self, $name) = @_; |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
|
if ($name eq 'value') { |
46
|
0
|
|
|
|
|
|
return $self->find('.//input[@type="hidden" |
47
|
|
|
|
|
|
|
and @data-dojo-attach-point="valueNode"]') |
48
|
|
|
|
|
|
|
->get_attribute('value'); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
else { |
51
|
0
|
|
|
|
|
|
return $self->SUPER::get_attribute($name); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |