From 138cac153cffdafe9c77976fab3ef3ad73269119 Mon Sep 17 00:00:00 2001 From: James Seppi Date: Wed, 17 Sep 2014 11:55:29 -0500 Subject: [PATCH] cleanup package.json and bower.json, bump release to 0.3.1 --- README.md | 7 - bower.json | 11 +- dist/angular-dropdowns.css | 307 +++++++++++++++++----------------- dist/angular-dropdowns.js | 97 ++++++----- dist/angular-dropdowns.min.js | 2 +- package.json | 19 ++- 6 files changed, 227 insertions(+), 216 deletions(-) diff --git a/README.md b/README.md index 88bc8b2..80937f8 100644 --- a/README.md +++ b/README.md @@ -90,13 +90,6 @@ You can specify a function to call upon dropdown value change by specifying the ``` -## Contributors - -* [@jseppi](http://github.com/jseppi) -* [@alexisbg](http://github.com/alexisbg) -* [@elishacook](http://github.com/elishacook) -* [@dinodsaurus](https://github.com/dinodsaurus) - ## Developing Pull requests are welcome! diff --git a/bower.json b/bower.json index abff464..d1ed9bd 100644 --- a/bower.json +++ b/bower.json @@ -1,9 +1,16 @@ { "name": "angular-dropdowns", - "version": "0.3.0", + "version": "0.3.1", "homepage": "https://github.com/jseppi/angular-dropdowns", "authors": [ - "James Seppi" + "James Seppi (http://github.com/jseppi)", + "eddimonge", + "JustMaier", + "ramiroaraujo", + "tlvince", + "dinodsaurus", + "elishacook", + "alexisbg" ], "description": "AngularJS Dropdown Directives", "main": [ diff --git a/dist/angular-dropdowns.css b/dist/angular-dropdowns.css index 42a44a6..f0e830f 100644 --- a/dist/angular-dropdowns.css +++ b/dist/angular-dropdowns.css @@ -1,216 +1,215 @@ - /****** dropdown-select *******/ .wrap-dd-select { - /* Size and position */ - position: relative; - width: 200px; - margin: 0 auto; - padding: 10px; - - /* Styles */ - background: #fff; - border-radius: 7px; - border: 1px solid rgba(0,0,0,0.15); - box-shadow: 0 1px 1px rgba(50,50,50,0.1); - cursor: pointer; - outline: none; - - /* Font settings */ - font-weight: bold; - color: #8AA8BD; + /* Size and position */ + position: relative; + width: 200px; + margin: 0 auto; + padding: 10px; + + /* Styles */ + background: #fff; + border-radius: 7px; + border: 1px solid rgba(0,0,0,0.15); + box-shadow: 0 1px 1px rgba(50,50,50,0.1); + cursor: pointer; + outline: none; + + /* Font settings */ + font-weight: bold; + color: #8AA8BD; } .wrap-dd-select:after { - content: ""; - width: 0; - height: 0; - position: absolute; - right: 15px; - top: 50%; - margin-top: -3px; - border-width: 6px 6px 0 6px; - border-style: solid; - border-color: #8aa8bd transparent; + content: ""; + width: 0; + height: 0; + position: absolute; + right: 15px; + top: 50%; + margin-top: -3px; + border-width: 6px 6px 0 6px; + border-style: solid; + border-color: #8aa8bd transparent; } .wrap-dd-select .dropdown { - /* Size & position */ - position: absolute; - top: 100%; - left: 0; - right: 0; - - /* Styles */ - background: white; - padding: 0; - border-radius: inherit; - border: 1px solid rgba(0,0,0,0.17); - box-shadow: 0 0 5px rgba(0,0,0,0.1); - font-weight: normal; - transition: all 0.2s ease-in; - list-style: none; - - /* Hiding */ - opacity: 0; - pointer-events: none; + /* Size & position */ + position: absolute; + top: 100%; + left: 0; + right: 0; + + /* Styles */ + background: white; + padding: 0; + border-radius: inherit; + border: 1px solid rgba(0,0,0,0.17); + box-shadow: 0 0 5px rgba(0,0,0,0.1); + font-weight: normal; + transition: all 0.2s ease-in; + list-style: none; + + /* Hiding */ + opacity: 0; + pointer-events: none; } .wrap-dd-select .dropdown li.divider { - padding: 2px 0; - background: #e6e8ea; + padding: 2px 0; + background: #e6e8ea; } .wrap-dd-select .dropdown li a { - display: block; - padding: 10px; - text-decoration: none; - color: #8aa8bd; - border-bottom: 1px solid #e6e8ea; - box-shadow: inset 0 1px 0 rgba(255,255,255,1); - transition: all 0.3s ease-out; + display: block; + padding: 10px; + text-decoration: none; + color: #8aa8bd; + border-bottom: 1px solid #e6e8ea; + box-shadow: inset 0 1px 0 rgba(255,255,255,1); + transition: all 0.3s ease-out; } .wrap-dd-select .dropdown li i { - float: right; - color: inherit; + float: right; + color: inherit; } - + .wrap-dd-select .dropdown li:first-of-type a { - border-radius: 7px 7px 0 0; + border-radius: 7px 7px 0 0; } - + .wrap-dd-select .dropdown li:last-of-type a { - border-radius: 0 0 7px 7px; - border: none; + border-radius: 0 0 7px 7px; + border: none; } - + /* Hover state */ - + .wrap-dd-select .dropdown li:hover a { - background: #f3f8f8; + background: #f3f8f8; } .wrap-dd-select .dropdown:after { - content: ""; - width: 0; - height: 0; - position: absolute; - bottom: 100%; - right: 15px; - border-width: 0 6px 6px 6px; - border-style: solid; - border-color: #fff transparent; -} - + content: ""; + width: 0; + height: 0; + position: absolute; + bottom: 100%; + right: 15px; + border-width: 0 6px 6px 6px; + border-style: solid; + border-color: #fff transparent; +} + .wrap-dd-select .dropdown:before { - content: ""; - width: 0; - height: 0; - position: absolute; - bottom: 100%; - right: 13px; - border-width: 0 8px 8px 8px; - border-style: solid; - border-color: rgba(0,0,0,0.1) transparent; + content: ""; + width: 0; + height: 0; + position: absolute; + bottom: 100%; + right: 13px; + border-width: 0 8px 8px 8px; + border-style: solid; + border-color: rgba(0,0,0,0.1) transparent; } .wrap-dd-select.active .dropdown { - opacity: 1; - pointer-events: auto; + opacity: 1; + pointer-events: auto; } /****** dropdown-menu *******/ .wrap-dd-menu { - /* Size and position */ - position: relative; - width: 200px; - margin: 0 auto; - padding: 10px; + /* Size and position */ + position: relative; + width: 200px; + margin: 0 auto; + padding: 10px; } .wrap-dd-menu .dropdown { - /* Size & position */ - position: absolute; - z-index: 1; - top: 70%; - left: 0; - right: 0; - - /* Styles */ - background: white; - padding: 0; - border-radius: 7px; - border: 1px solid rgba(0,0,0,0.17); - box-shadow: 0 0 5px rgba(0,0,0,0.1); - font-weight: normal; - transition: all 0.2s ease-in; - list-style: none; - - /* Hiding */ - opacity: 0; - pointer-events: none; + /* Size & position */ + position: absolute; + z-index: 1; + top: 70%; + left: 0; + right: 0; + + /* Styles */ + background: white; + padding: 0; + border-radius: 7px; + border: 1px solid rgba(0,0,0,0.17); + box-shadow: 0 0 5px rgba(0,0,0,0.1); + font-weight: normal; + transition: all 0.2s ease-in; + list-style: none; + + /* Hiding */ + opacity: 0; + pointer-events: none; } .wrap-dd-menu .dropdown li.divider { - padding: 2px 0; - background: #e6e8ea; + padding: 2px 0; + background: #e6e8ea; } .wrap-dd-menu .dropdown li a { - display: block; - padding: 10px; - text-decoration: none; - color: #8aa8bd; - border-bottom: 1px solid #e6e8ea; - box-shadow: inset 0 1px 0 rgba(255,255,255,1); - transition: all 0.3s ease-out; + display: block; + padding: 10px; + text-decoration: none; + color: #8aa8bd; + border-bottom: 1px solid #e6e8ea; + box-shadow: inset 0 1px 0 rgba(255,255,255,1); + transition: all 0.3s ease-out; } .wrap-dd-menu .dropdown li i { - float: right; - color: inherit; + float: right; + color: inherit; } - + .wrap-dd-menu .dropdown li:first-of-type a { - border-radius: 7px 7px 0 0; + border-radius: 7px 7px 0 0; } - + .wrap-dd-menu .dropdown li:last-of-type a { - border-radius: 0 0 7px 7px; - border: none; + border-radius: 0 0 7px 7px; + border: none; } - + /* Hover state */ - + .wrap-dd-menu .dropdown li:hover a { - background: #f3f8f8; + background: #f3f8f8; } .wrap-dd-menu .dropdown:after { - content: ""; - width: 0; - height: 0; - position: absolute; - bottom: 100%; - border-width: 0 6px 6px 6px; - border-style: solid; - border-color: #fff transparent; -} - + content: ""; + width: 0; + height: 0; + position: absolute; + bottom: 100%; + border-width: 0 6px 6px 6px; + border-style: solid; + border-color: #fff transparent; +} + .wrap-dd-menu .dropdown:before { - content: ""; - width: 0; - height: 0; - position: absolute; - bottom: 100%; - right: 95px; - border-width: 0 8px 8px 8px; - border-style: solid; - border-color: rgba(0,0,0,0.1) transparent; + content: ""; + width: 0; + height: 0; + position: absolute; + bottom: 100%; + right: 95px; + border-width: 0 8px 8px 8px; + border-style: solid; + border-color: rgba(0,0,0,0.1) transparent; } .wrap-dd-menu .dropdown.active { - opacity: 1; - pointer-events: auto; -} \ No newline at end of file + opacity: 1; + pointer-events: auto; +} diff --git a/dist/angular-dropdowns.js b/dist/angular-dropdowns.js index f8b9bae..604b5ac 100644 --- a/dist/angular-dropdowns.js +++ b/dist/angular-dropdowns.js @@ -17,7 +17,7 @@ dd.directive('dropdownSelect', ['DropdownService', '$window', controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) { $scope.labelField = $attrs.dropdownItemLabel || 'text'; - + DropdownService.register($element); this.select = function (selected) { @@ -28,28 +28,30 @@ dd.directive('dropdownSelect', ['DropdownService', '$window', selected: selected }); }; - + var $clickEvent = ('ontouchstart' in $window ? 'touchend' : 'click'); $element.bind($clickEvent, function (event) { event.stopPropagation(); DropdownService.toggleActive($element); }); - + $scope.$on('$destroy', function () { DropdownService.unregister($element); }); }], - template: "
" + - " {{dropdownModel[labelField]}}" + - " " + - "
" + template: [ + '
', + '{{dropdownModel[labelField]}}', + '', + '
' + ].join('') }; } ]); @@ -73,29 +75,22 @@ dd.directive('dropdownSelectItem', [ }; }, - template: "
  • " + - " " + - " {{dropdownSelectItem[dropdownItemLabel]}}" + - " " + - "
  • " + template: [ + '
  • ', + '', + '{{dropdownSelectItem[dropdownItemLabel]}}', + '', + '
  • ' + ].join('') }; } ]); dd.directive('dropdownMenu', ['$parse', '$compile', 'DropdownService', '$window', function ($parse, $compile, DropdownService, $window) { - - var template = ""; - return { restrict: 'A', replace: false, @@ -107,21 +102,29 @@ dd.directive('dropdownMenu', ['$parse', '$compile', 'DropdownService', '$window' controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) { $scope.labelField = $attrs.dropdownItemLabel || 'text'; - + var $clickEvent = ('ontouchstart' in $window ? 'touchend' : 'click'); - var $template = angular.element(template); + var $template = angular.element([ + '' + ].join('')); // Attach this controller to the element's data $template.data('$dropdownMenuController', this); - + var tpl = $compile($template)($scope); - var $wrap = angular.element("
    "); - + var $wrap = angular.element('
    '); + $element.replaceWith($wrap); $wrap.append($element); $wrap.append(tpl); DropdownService.register(tpl); - + this.select = function (selected) { if (selected !== $scope.dropdownModel) { angular.copy(selected, $scope.dropdownModel); @@ -163,14 +166,16 @@ dd.directive('dropdownMenuItem', [ }; }, - template: "
  • " + - " " + - " {{dropdownMenuItem[dropdownItemLabel]}}" + - " " + - "
  • " + template: [ + '
  • ', + '', + '{{dropdownMenuItem[dropdownItemLabel]}}', + '', + '
  • ' + ].join('') }; } ]); @@ -182,7 +187,7 @@ dd.factory('DropdownService', ['$document', _dropdowns = []; body.bind('click', function () { - return angular.forEach(_dropdowns, function (el) { + angular.forEach(_dropdowns, function (el) { el.removeClass('active'); }); }); @@ -211,4 +216,4 @@ dd.factory('DropdownService', ['$document', return service; } -]); \ No newline at end of file +]); diff --git a/dist/angular-dropdowns.min.js b/dist/angular-dropdowns.min.js index a9fe127..36c50f2 100644 --- a/dist/angular-dropdowns.min.js +++ b/dist/angular-dropdowns.min.js @@ -1,4 +1,4 @@ /** * @license MIT http://jseppi.mit-license.org/license.html */ -"use strict";var dd=angular.module("ngDropdowns",[]);dd.directive("dropdownSelect",["DropdownService","$window",function(e,o){return{restrict:"A",replace:!0,scope:{dropdownSelect:"=",dropdownModel:"=",dropdownOnchange:"&"},controller:["$scope","$element","$attrs",function(n,d,t){n.labelField=t.dropdownItemLabel||"text",e.register(d),this.select=function(e){e!==n.dropdownModel&&angular.copy(e,n.dropdownModel),n.dropdownOnchange({selected:e})};var r="ontouchstart"in o?"touchend":"click";d.bind(r,function(o){o.stopPropagation(),e.toggleActive(d)}),n.$on("$destroy",function(){e.unregister(d)})}],template:"
    {{dropdownModel[labelField]}}
    "}}]),dd.directive("dropdownSelectItem",[function(){return{require:"^dropdownSelect",replace:!0,scope:{dropdownItemLabel:"=",dropdownSelectItem:"="},link:function(e,o,n,d){e.selectItem=function(){e.dropdownSelectItem.href||d.select(e.dropdownSelectItem)}},template:"
  • {{dropdownSelectItem[dropdownItemLabel]}}
  • "}}]),dd.directive("dropdownMenu",["$parse","$compile","DropdownService","$window",function(e,o,n,d){var t="";return{restrict:"A",replace:!1,scope:{dropdownMenu:"=",dropdownModel:"=",dropdownOnchange:"&"},controller:["$scope","$element","$attrs",function(e,r,l){e.labelField=l.dropdownItemLabel||"text";var i="ontouchstart"in d?"touchend":"click",c=angular.element(t);c.data("$dropdownMenuController",this);var p=o(c)(e),a=angular.element("
    ");r.replaceWith(a),a.append(r),a.append(p),n.register(p),this.select=function(o){o!==e.dropdownModel&&angular.copy(o,e.dropdownModel),e.dropdownOnchange({selected:o})},r.bind(i,function(e){e.stopPropagation(),n.toggleActive(p)}),e.$on("$destroy",function(){n.unregister(p)})}]}}]),dd.directive("dropdownMenuItem",[function(){return{require:"^dropdownMenu",replace:!0,scope:{dropdownMenuItem:"=",dropdownItemLabel:"="},link:function(e,o,n,d){e.selectItem=function(){e.dropdownMenuItem.href||d.select(e.dropdownMenuItem)}},template:"
  • {{dropdownMenuItem[dropdownItemLabel]}}
  • "}}]),dd.factory("DropdownService",["$document",function(e){var o=e.find("body"),n={},d=[];return o.bind("click",function(){return angular.forEach(d,function(e){e.removeClass("active")})}),n.register=function(e){d.push(e)},n.unregister=function(e){var o;o=d.indexOf(e),o>-1&&d.splice(o,1)},n.toggleActive=function(e){angular.forEach(d,function(o){o!==e&&o.removeClass("active")}),e.toggleClass("active")},n}]); \ No newline at end of file +"use strict";var dd=angular.module("ngDropdowns",[]);dd.directive("dropdownSelect",["DropdownService","$window",function(e,o){return{restrict:"A",replace:!0,scope:{dropdownSelect:"=",dropdownModel:"=",dropdownOnchange:"&"},controller:["$scope","$element","$attrs",function(n,d,t){n.labelField=t.dropdownItemLabel||"text",e.register(d),this.select=function(e){e!==n.dropdownModel&&angular.copy(e,n.dropdownModel),n.dropdownOnchange({selected:e})};var r="ontouchstart"in o?"touchend":"click";d.bind(r,function(o){o.stopPropagation(),e.toggleActive(d)}),n.$on("$destroy",function(){e.unregister(d)})}],template:['
    ','{{dropdownModel[labelField]}}','","
    "].join("")}}]),dd.directive("dropdownSelectItem",[function(){return{require:"^dropdownSelect",replace:!0,scope:{dropdownItemLabel:"=",dropdownSelectItem:"="},link:function(e,o,n,d){e.selectItem=function(){e.dropdownSelectItem.href||d.select(e.dropdownSelectItem)}},template:['
  • ','',"{{dropdownSelectItem[dropdownItemLabel]}}","","
  • "].join("")}}]),dd.directive("dropdownMenu",["$parse","$compile","DropdownService","$window",function(e,o,n,d){return{restrict:"A",replace:!1,scope:{dropdownMenu:"=",dropdownModel:"=",dropdownOnchange:"&"},controller:["$scope","$element","$attrs",function(e,t,r){e.labelField=r.dropdownItemLabel||"text";var i="ontouchstart"in d?"touchend":"click",l=angular.element(['"].join(""));l.data("$dropdownMenuController",this);var c=o(l)(e),p=angular.element('
    ');t.replaceWith(p),p.append(t),p.append(c),n.register(c),this.select=function(o){o!==e.dropdownModel&&angular.copy(o,e.dropdownModel),e.dropdownOnchange({selected:o})},t.bind(i,function(e){e.stopPropagation(),n.toggleActive(c)}),e.$on("$destroy",function(){n.unregister(c)})}]}}]),dd.directive("dropdownMenuItem",[function(){return{require:"^dropdownMenu",replace:!0,scope:{dropdownMenuItem:"=",dropdownItemLabel:"="},link:function(e,o,n,d){e.selectItem=function(){e.dropdownMenuItem.href||d.select(e.dropdownMenuItem)}},template:['
  • ','',"{{dropdownMenuItem[dropdownItemLabel]}}","","
  • "].join("")}}]),dd.factory("DropdownService",["$document",function(e){var o=e.find("body"),n={},d=[];return o.bind("click",function(){angular.forEach(d,function(e){e.removeClass("active")})}),n.register=function(e){d.push(e)},n.unregister=function(e){var o;o=d.indexOf(e),o>-1&&d.splice(o,1)},n.toggleActive=function(e){angular.forEach(d,function(o){o!==e&&o.removeClass("active")}),e.toggleClass("active")},n}]); \ No newline at end of file diff --git a/package.json b/package.json index 82a63af..c7290bd 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,30 @@ { "name": "angular-dropdowns", - "version": "0.3.0", + "version": "0.3.1", "author": { "name": "James Seppi", + "email": "james.seppi@gmail.com", "url": "http://www.github.com/jseppi" }, + "homepage": "https://github.com/jseppi/angular-dropdowns", + "bugs": "https://github.com/jseppi/angular-dropdowns/issues", + "keywords": ["angular", "dropdown", "menu", "select"], "description": "AngularJS Dropdown Directives", "license": "MIT", "contributors": [ - { - "name": "James Seppi", - "email": "james.seppi@gmail.com", - "url": "https://github.com/jseppi" - } + "eddimonge", + "JustMaier", + "ramiroaraujo", + "tlvince", + "dinodsaurus", + "elishacook", + "alexisbg" ], "repository": { "type": "git", "url": "https://github.com/jseppi/angular-dropdowns.git" }, + "dependencies": {}, "devDependencies": { "gulp": "^3.8.7", "gulp-jshint": "^1.8.4",