Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
0a294037
Commit
0a294037
authored
May 27, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add getPositionValue methode in progress gadget
parent
8d1e93b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
src/audioplayer_progress/index.html
src/audioplayer_progress/index.html
+1
-0
src/audioplayer_progress/progress.js
src/audioplayer_progress/progress.js
+17
-7
No files found.
src/audioplayer_progress/index.html
View file @
0a294037
...
...
@@ -8,6 +8,7 @@
<!-- renderjs -->
<script
src=
"../<%= copy.rsvp.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= copy.renderjs.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= curl.jquery.relative_dest %>"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"./progress.js"
type=
"text/javascript"
></script>
...
...
src/audioplayer_progress/progress.js
View file @
0a294037
/*global window, rJS, RSVP, console */
/*jslint
maxlen:80,
nomen: true */
/*global window, rJS, RSVP, console
, $, jQuery
*/
/*jslint nomen: true */
(
function
(
window
,
rJS
)
{
(
function
(
window
,
rJS
,
$
)
{
"
use strict
"
;
var
gk
=
rJS
(
window
);
...
...
@@ -17,11 +17,21 @@
})
.
declareMethod
(
'
getMax
'
,
function
()
{
return
this
.
bar
.
max
;
})
.
declareMethod
(
'
getPositionValue
'
,
function
(
e
)
{
var
posX
=
e
.
clientX
,
targetLeft
=
$
(
this
.
bar
).
offset
().
left
;
posX
=
((
posX
-
targetLeft
)
/
$
(
this
.
bar
).
width
());
return
posX
*
this
.
bar
.
max
;
})
.
declareMethod
(
'
setAction
'
,
function
(
type
,
action
)
{
this
.
bar
[
type
]
=
function
(
e
)
{
action
.
call
(
this
,
e
);
};
});
gk
.
ready
(
function
(
g
)
{
g
.
bar
=
g
.
__element
.
getElementsByTagName
(
'
progress
'
)[
0
];
g
.
bar
.
value
=
1
0
;
g
.
bar
.
max
=
100
;
g
.
bar
.
value
=
0
;
g
.
bar
.
max
=
100
0
;
});
}(
window
,
rJS
));
}(
window
,
rJS
,
jQuery
));
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