angularjs-tree 0.2.0 → 1.1.0

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.
@@ -0,0 +1,18 @@
1
+ on:
2
+ release:
3
+ types: [published]
4
+ name: Publish
5
+ jobs:
6
+ publish:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+ - uses: actions/setup-node@v3
11
+ with:
12
+ node-version: '16.x'
13
+ registry-url: 'https://registry.npmjs.org'
14
+ scope: '@amalfra'
15
+ - run: npm ci
16
+ - run: npm publish
17
+ env:
18
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  Angularjs tree
2
2
  ====
3
3
  [![npm](https://img.shields.io/npm/v/angularjs-tree.svg)](https://www.npmjs.com/package/angularjs-tree)
4
- [![Bower](https://img.shields.io/bower/v/angularjs-tree.svg)](https://www.npmjs.com/package/angularjs-tree)
5
4
 
6
5
  A simple directive for creating tree lists with angularjs
7
6
 
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Angularjs-tree - v0.0.1
3
- * (c) 2015-08-15. https://github.com/amalfra/angularjs-tree
2
+ * angularjs-tree - v1.1.0
3
+ * (c) 2025-11-24. https://github.com/amalfra/angularjs-tree
4
4
  * License: MIT
5
5
  */
6
- !function(a,b,c){"use strict";b.module("angularjs.tree",[]).directive("tree",["$document",function(a){return{restrict:"A",scope:{callback:"&treeCallback"},link:function(a,c){b.forEach(b.element(c).children(),function(c,d){var e=b.element(c)[0].querySelector("a"),f=b.element(c)[0].querySelector(".treeview-menu"),g=b.element(c).hasClass("active");g?b.element(f).css("display","block"):b.element(f).css("display","none"),null!=f&&b.element(e).bind("click",function(c){c.preventDefault(),g?(b.element(f).css("display","none"),g=!1,b.element(e).parent("li").removeClass("active")):(b.element(f).css("display","block"),g=!0,b.element(e).parent("li").addClass("active")),a.callback({event:c})})})}}}])}(window,window.angular);
6
+
7
+ !function(i){"use strict";i.module("angularjs.tree",[]).directive("tree",["$document",function(e){return{restrict:"A",scope:{callback:"&treeCallback"},link:function(a,e){i.forEach(i.element(e).children(),function(e,n){var l=i.element(e)[0].querySelector("a"),t=i.element(e)[0].querySelector(".treeview-menu"),c=i.element(e).hasClass("active");c?i.element(t).css("display","block"):i.element(t).css("display","none"),null!=t&&i.element(l).bind("click",function(e){e.preventDefault(),c?(i.element(t).css("display","none"),c=!1,i.element(l).parent("li").removeClass("active")):(i.element(t).css("display","block"),c=!0,i.element(l).parent("li").addClass("active")),a.callback({event:e})})})}}}])}((window,window.angular));
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
5
+ <script src="../src/angularjs-tree.js"></script>
6
+ <title>Angular tree demo</title>
7
+ <script>
8
+ angular.module('demoApp', ['angularjs.tree']).controller('demoController', ['$scope', function($scope) {
9
+ $scope.blah = function(event){
10
+ console.log(event);
11
+ };
12
+ }]);
13
+ </script>
14
+ </head>
15
+ <body data-ng-app="demoApp">
16
+ <div data-ng-controller="demoController">
17
+ <ul data-tree data-tree-callback="blah(event)">
18
+ <li>
19
+ <a href="#one">
20
+ Root1
21
+ </a>
22
+ </li>
23
+ <li>
24
+ <a href="#two">
25
+ Root2
26
+ </a>
27
+ <ul class="treeview-menu">
28
+ <li><a href="#two1">A</a></li>
29
+ <li><a href="#two2">B</a></li>
30
+ <li><a href="#two3">C</a></li>
31
+ </ul>
32
+ </li>
33
+ <li>
34
+ <a href="#three">
35
+ Root3
36
+ </a>
37
+ <ul class="treeview-menu">
38
+ <li><a href="#three1">A</a></li>
39
+ <li><a href="#three2">B</a></li>
40
+ </ul>
41
+ </li>
42
+ <li>
43
+ <a href="#four">
44
+ Root4
45
+ </a>
46
+ <ul class="treeview-menu">
47
+ <li><a href="#four1">A</a></li>
48
+ </ul>
49
+ </li>
50
+ </ul>
51
+ </div>
52
+ </body>
53
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angularjs-tree",
3
- "version": "0.2.0",
3
+ "version": "1.1.0",
4
4
  "description": "A simple directive for creating tree lists with angularjs",
5
5
  "author": "Amal Francis",
6
6
  "bugs": {
package/bower.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "name": "angularjs-tree",
3
- "version": "0.1.0",
4
- "authors": [
5
- "Amal Francis <amalfra@gmail.com>"
6
- ],
7
- "description": "A simple directive for creating tree lists with angularjs",
8
- "main": ["src/angularjs-tree.js"],
9
- "moduleType": [
10
- "globals"
11
- ],
12
- "keywords": [
13
- "angularjs",
14
- "tree"
15
- ],
16
- "license": "MIT",
17
- "homepage": "https://github.com/amalfra/angularjs-tree",
18
- "ignore": [
19
- "**/.*",
20
- "node_modules",
21
- "bower_components",
22
- "test",
23
- "tests"
24
- ]
25
- }