Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
43723385
Commit
43723385
authored
May 18, 2012
by
Andrew Smith
Committed by
Felix Schäfer
May 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle the '(Un)Check all' link. #994
parent
93abdcf4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
_list.rhtml
app/views/issues/_list.rhtml
+1
-2
context_menu.jquery.js
public/javascripts/context_menu.jquery.js
+20
-0
No files found.
app/views/issues/_list.rhtml
View file @
43723385
...
...
@@ -3,8 +3,7 @@
<div
class=
"autoscroll"
>
<table
class=
"list issues"
>
<thead><tr>
<th
class=
"checkbox hide-when-print"
>
<%=
link_to
image_tag
(
'toggle_check.png'
),
{},
:onclick
=>
'toggleIssuesSelection(Element.up(this, "form")); return false;'
,
:title
=>
"
#{
l
(
:button_check_all
)
}
/
#{
l
(
:button_uncheck_all
)
}
"
%>
<th
class=
"checkbox hide-when-print"
>
<%=
link_to
image_tag
(
'toggle_check.png'
),
{},
:title
=>
"
#{
l
(
:button_check_all
)
}
/
#{
l
(
:button_uncheck_all
)
}
"
%>
</th>
<%=
sort_header_tag
(
'id'
,
:caption
=>
'#'
,
:default_order
=>
'desc'
)
%>
<%
query
.
columns
.
each
do
|
column
|
%>
...
...
public/javascripts/context_menu.jquery.js
View file @
43723385
...
...
@@ -3,6 +3,7 @@
var
element
=
el
;
var
opts
=
options
;
var
observingContextMenuClick
;
var
observingToggleAllClick
;
var
lastSelected
=
null
;
var
menu
;
var
menuId
=
'context-menu'
;
...
...
@@ -194,6 +195,20 @@
inputs
.
each
(
function
()
{
inputs
.
attr
(
'checked'
,
checked
?
'checked'
:
false
);
});
},
toggleIssuesSelection
:
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
var
issues
=
$
(
this
).
parents
(
'form'
).
find
(
'tr.issue'
);
var
checked
=
methods
.
isSelected
(
issues
.
eq
(
0
));
issues
.
each
(
function
()
{
var
self
=
$
(
this
);
if
(
checked
)
{
methods
.
removeSelection
(
self
)
}
else
{
methods
.
addSelection
(
self
);
}
});
}
};
...
...
@@ -205,6 +220,11 @@
observingContextMenuClick
=
true
;
}
if
(
!
observingToggleAllClick
)
{
element
.
find
(
'.issues img[alt="Toggle_check"]'
).
bind
(
'click'
,
methods
.
toggleIssuesSelection
);
observingToggleAllClick
=
true
;
}
methods
.
unselectAll
();
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment