Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Drupal
Sharer toolbar module
Commits
ec18eeb1
Commit
ec18eeb1
authored
Jun 03, 2015
by
Alexis Piéplu
Browse files
Correct duplicate id, add BEM Class, correct title attribute to data-title
parent
87911b2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/sharer-opener.js
View file @
ec18eeb1
...
...
@@ -7,7 +7,7 @@
(
function
(
$
)
{
Drupal
.
behaviors
.
sharerOpener
=
{
attach
:
function
(
context
,
settings
)
{
$
(
'
#sharer-toolbar
a
'
,
context
).
click
(
function
()
{
$
(
'
#sharer-toolbar
-list
'
,
context
).
find
(
'
.shareLink__link
'
).
click
(
function
()
{
// Parse URL to get protocol
var
parser
=
document
.
createElement
(
'
a
'
);
...
...
@@ -15,7 +15,7 @@
// Open popup if protocol is different from «mailto»
if
(
parser
.
protocol
!==
'
mailto:
'
)
{
window
.
open
(
$
(
this
).
attr
(
'
href
'
),
$
(
this
).
at
tr
(
'
title
'
),
"
width=640, height=480
"
);
window
.
open
(
$
(
this
).
attr
(
'
href
'
),
$
(
this
).
d
at
a
(
'
title
'
),
"
width=640, height=480
"
);
return
false
;
}
});
...
...
sharer-toolbar.tpl.php
View file @
ec18eeb1
...
...
@@ -6,12 +6,12 @@
*/
?>
<div
id=
"sharer-toolbar-container"
>
<
div
id=
"sharer-toolbar"
>
<?php
print
t
(
$title
);
?>
</
div
>
<ul
id=
"sharer-toolbar"
>
<div
id=
"sharer-toolbar-container"
class=
"shareLink"
>
<
button
id=
"sharer-toolbar
-btn"
class=
"shareLink__trigger
"
>
<?php
print
t
(
$title
);
?>
</
button
>
<ul
id=
"sharer-toolbar
-list"
class=
"shareLink__list
"
>
<?php
foreach
(
$sharers
as
$sid
=>
$sharer
)
:
?>
<li
class=
"shareLink__
<?php
print
$sid
;
?>
"
>
<a
href=
"
<?php
print
$sharer
[
'url'
];
?>
"
title=
"
<?php
print
t
(
$sharer
[
'label'
]);
?>
"
>
<li
class=
"shareLink__
item shareLink__item--
<?php
print
$sid
;
?>
"
>
<a
class=
"shareLink__link shareLink__link--
<?php
print
$sid
;
?>
"
href=
"
<?php
print
$sharer
[
'url'
];
?>
"
data-
title=
"
<?php
print
t
(
$sharer
[
'label'
]);
?>
"
>
<i
class=
"
<?php
print
$sharer
[
'icon_class'
];
?>
"
></i>
<?php
print
t
(
$sharer
[
'label'
]);
?>
</a>
</li>
...
...
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