diff --git a/app/index.html b/app/index.html index 493c167..af9c12b 100644 --- a/app/index.html +++ b/app/index.html @@ -16,7 +16,7 @@ - +
@@ -50,16 +50,46 @@
Input format
<input type="datetime" ng-model="model" date-time format="long"></div> 
+
A button
+
<div class="dropdown">
+  <a class="dropdown-toggle btn btn-danger">
+    pick a date: {{(date|date)}}
+  </a>
+  <div class="dropdown-menu" ng-click="$event.preventDefault();$event.stopPropagation()">
+    <div date-picker="date" class="datetimepicker"></div>
+  </div>
+</div>
+
Date range
<div date-range start="start" end="end" ></div> 
-
+
+
Date range button
+
+ + diff --git a/app/scripts/module.js b/app/scripts/module.js index 0e918e0..e858f31 100644 --- a/app/scripts/module.js +++ b/app/scripts/module.js @@ -384,12 +384,12 @@ if (!picker) { picker = $compile('')(scope); body.append(picker); + scope.$digest(); + var pos = angular.extend({}, element.position(), { height: element[0].offsetHeight }); + picker.css({ top: pos.top + pos.height, left: pos.left, display: 'block', position: 'absolute'}); picker.bind('mousedown', function () { return false; }); - var pos = angular.extend({}, element.position(), { height: element[0].offsetHeight }); - picker.css({ top: pos.top + pos.height, left: pos.left, display: 'block', position: 'absolute'}); - scope.$digest(); } return false; }); @@ -405,7 +405,7 @@ Module.directive('dateRange', function () { return { - template: '', + template: '
\n \n \n \n \n \n
\n \n \n
', scope : { start: '=', end : '=' diff --git a/bower.json b/bower.json index 50921b0..e0cf135 100644 --- a/bower.json +++ b/bower.json @@ -15,6 +15,7 @@ "es5-shim": "~2.0.8", "jquery": "~2.0.2", "angular-mocks": "~1.0.5", - "angular-scenario": "~1.0.5" + "angular-scenario": "~1.0.5", + "angular-bootstrap": "~0.3.0" } }