@lemonadejs/tabs 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,7 +67,7 @@ You can configure things such as tabs titles, tabs contents and selected tab.
67
67
 
68
68
  ## License
69
69
 
70
- The [LemonadeJS](https://lemonadejs.net) tabs is released under the MIT.
70
+ The [LemonadeJS](https://lemonadejs.net) Tabs is released under the MIT.
71
71
 
72
72
  ## Other Tools
73
73
 
package/dist/index.js CHANGED
@@ -65,7 +65,12 @@ if (!lemonade && typeof (require) === 'function') {
65
65
 
66
66
  return function (root, options) {
67
67
  if (typeof (root) === 'object') {
68
- lemonade.render(Tabs, root, options)
68
+ // Get HTML inside the wrapper element then empty it
69
+ const template = root.innerHTML
70
+ root.innerHTML = ''
71
+
72
+ // Send Template as a parameter for the Lemonade component
73
+ lemonade.render(Tabs, root, options, template)
69
74
  return options;
70
75
  } else {
71
76
  return Tabs.call(this, root)
package/package.json CHANGED
@@ -16,5 +16,5 @@
16
16
  "lemonadejs": "^3.3.1"
17
17
  },
18
18
  "main": "dist/index.js",
19
- "version": "1.0.2"
19
+ "version": "1.0.4"
20
20
  }
package/src/index.html ADDED
@@ -0,0 +1,16 @@
1
+ <script src="https://cdn.jsdelivr.net/npm/lemonadejs@3.3.1/dist/lemonade.min.js"></script>
2
+ <script src="../dist/index.js"></script>
3
+ <link rel="stylesheet" href="../dist/style.css" />
4
+
5
+ <div id="tabs">
6
+ <div title="Tab 1">Content of the first tab</div>
7
+ <div title="Tab 2">Content of the second tab</div>
8
+ </div>
9
+
10
+ <script>
11
+ const root = document.getElementById("tabs");
12
+
13
+ Tabs(root, {
14
+ selected: 0
15
+ });
16
+ </script>