Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
aa301a80
Commit
aa301a80
authored
Sep 17, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted tooltips to coffee too, and removed both converted files from the included js header.
parent
daa38af5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
58 deletions
+47
-58
lms/static/coffee/src/discussion/tooltips.coffee
+47
-0
lms/static/js/tooltips.js
+0
-56
lms/templates/discussion/_js_head_dependencies.html
+0
-2
No files found.
lms/static/coffee/src/discussion/tooltips.coffee
0 → 100644
View file @
aa301a80
$
->
new
Tooltips
class
@
Tooltips
constructor
:
()
->
@
$body
=
$
(
'body'
)
@
$tooltip
=
$
(
'<div class="tooltip"></div>'
)
@
$body
.
delegate
'[data-tooltip]'
,
'mouseover'
:
@
showTooltip
,
'mousemove'
:
@
moveTooltip
,
'mouseout'
:
@
hideTooltip
,
'click'
:
@
hideTooltip
showTooltip
:
(
e
)
=>
tooltipText
=
$
(
e
.
target
).
attr
(
'data-tooltip'
)
@
$tooltip
.
html
(
tooltipText
)
@
$body
.
append
(
@
$tooltip
)
$
(
e
.
target
).
children
().
css
(
'pointer-events'
,
'none'
)
tooltipCoords
=
x
:
e
.
pageX
-
(
@
$tooltip
.
outerWidth
()
/
2
)
y
:
e
.
pageY
-
(
@
$tooltip
.
outerHeight
()
+
15
)
@
$tooltip
.
css
'left'
:
tooltipCoords
.
x
,
'top'
:
tooltipCoords
.
y
@
tooltipTimer
=
setTimeout
()
=>
@
$tooltip
.
show
().
css
(
'opacity'
,
1
)
@
tooltipTimer
=
setTimeout
()
=>
@
hideTooltip
()
,
3000
,
500
moveTooltip
:
(
e
)
=>
tooltipCoords
=
x
:
e
.
pageX
-
(
@
$tooltip
.
outerWidth
()
/
2
)
y
:
e
.
pageY
-
(
@
$tooltip
.
outerHeight
()
+
15
)
@
$tooltip
.
css
'left'
:
tooltipCoords
.
x
'top'
:
tooltipCoords
.
y
hideTooltip
:
(
e
)
=>
@
$tooltip
.
hide
().
css
(
'opacity'
,
0
)
clearTimeout
(
@
tooltipTimer
)
lms/static/js/tooltips.js
deleted
100644 → 0
View file @
daa38af5
var
$body
;
var
$tooltip
;
var
tooltipTimer
;
var
tooltipCoords
;
$
(
document
).
ready
(
function
()
{
$body
=
$
(
'body'
);
$tooltip
=
$
(
'<div class="tooltip"></div>'
);
$body
.
delegate
(
'[data-tooltip]'
,
{
'mouseover'
:
showTooltip
,
'mousemove'
:
moveTooltip
,
'mouseout'
:
hideTooltip
,
'click'
:
hideTooltip
});
});
function
showTooltip
(
e
)
{
var
tooltipText
=
$
(
this
).
attr
(
'data-tooltip'
);
$tooltip
.
html
(
tooltipText
);
$body
.
append
(
$tooltip
);
$
(
this
).
children
().
css
(
'pointer-events'
,
'none'
);
tooltipCoords
=
{
x
:
e
.
pageX
-
(
$tooltip
.
outerWidth
()
/
2
),
y
:
e
.
pageY
-
(
$tooltip
.
outerHeight
()
+
15
)
};
$tooltip
.
css
({
'left'
:
tooltipCoords
.
x
,
'top'
:
tooltipCoords
.
y
});
tooltipTimer
=
setTimeout
(
function
()
{
$tooltip
.
show
().
css
(
'opacity'
,
1
);
tooltipTimer
=
setTimeout
(
function
()
{
hideTooltip
();
},
3000
);
},
500
);
}
function
moveTooltip
(
e
)
{
tooltipCoords
=
{
x
:
e
.
pageX
-
(
$tooltip
.
outerWidth
()
/
2
),
y
:
e
.
pageY
-
(
$tooltip
.
outerHeight
()
+
15
)
};
$tooltip
.
css
({
'left'
:
tooltipCoords
.
x
,
'top'
:
tooltipCoords
.
y
});
}
function
hideTooltip
(
e
)
{
$tooltip
.
hide
().
css
(
'opacity'
,
0
);
clearTimeout
(
tooltipTimer
);
}
lms/templates/discussion/_js_head_dependencies.html
View file @
aa301a80
...
...
@@ -12,8 +12,6 @@
<script
type=
"text/javascript"
src=
"${static.url('js/URI.min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/underscore-min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/backbone-min.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/tooltips.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/discussion-filter.js')}"
></script>
<link
href=
"${static.url('css/vendor/jquery.tagsinput.css')}"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"${static.url('css/vendor/jquery.autocomplete.css')}"
rel=
"stylesheet"
type=
"text/css"
>
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