heiseonline / shariff

👮 Shariff enables website users to share their favorite content without compromising their privacy.
http://ct.de/-2467514
MIT License
1.4k stars 177 forks source link

shariff.min.js v1.8.0 #47

Closed mkra closed 9 years ago

mkra commented 9 years ago

When i include the new shariff/build/shariff.min.js v1.8.0 i get two sharling list in my shariff container.

pmb0 commented 9 years ago

Can you post a gist which reproduces the problem?

mkra commented 9 years ago

shariff https://gist.github.com/mkra/b3ac8050009e5e0ad2b4#file-shariff-test-html I used v1.9.1

pmb0 commented 9 years ago

Shariff runs before document.ready, right after the <script>-tag. In your example it is initialized a second time, which results in two rows of buttons.

Starting from 1.9.2 Shariff will make sure that the <div>-element does not have any children on initialization.

Additionally there is a data-attribute for setting the button orientation:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <link rel="stylesheet" type="text/css" href="shariff.complete.css">
</head>
<body>
    <div class="shariff" data-orientation="vertical"></div>

    <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
    <script src="shariff.min.js"></script>
</body>
</html>

Shariff is meant to be configured using the data-attributes. In most cases it is the easiest and fastest way to go.