File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change
1
+ <a name =" 0.8.1 " ></a >
2
+ # [ 0.8.1] ( https://github.com/isaacplmann/angular2-contextmenu/compare/v0.8.0...v0.8.1 ) (2017-02-28)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * ** position:** Default to 100x100 size if menuElement is undefined
8
+
9
+
10
+
1
11
<a name =" 0.8.0 " ></a >
2
12
# [ 0.8.0] ( https://github.com/isaacplmann/angular2-contextmenu/compare/v0.7.7...v0.8.0 ) (2017-02-27)
3
13
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " angular2-contextmenu" ,
3
- "version" : " 0.8.0 " ,
3
+ "version" : " 0.8.1 " ,
4
4
"description" : " An Angular 2 component to show a context menu on an arbitrary component" ,
5
5
"main" : " angular2-contextmenu.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ export class ContextMenuComponent implements AfterContentInit {
95
95
_contextMenuService . show . subscribe ( menuEvent => this . onMenuEvent ( menuEvent ) ) ;
96
96
}
97
97
98
- stopEvent ( $event : MouseEvent ) {
98
+ stopEvent ( $event : MouseEvent ) {
99
99
$event . stopPropagation ( )
100
100
}
101
101
@@ -179,8 +179,8 @@ export class ContextMenuComponent implements AfterContentInit {
179
179
this . hideMenu ( ) ;
180
180
}
181
181
setTimeout ( ( ) => {
182
- const menuWidth = this . menuElement . nativeElement . clientWidth ;
183
- const menuHeight = this . menuElement . nativeElement . clientHeight ;
182
+ const menuWidth = this . menuElement ? this . menuElement . nativeElement . clientWidth : 100 ;
183
+ const menuHeight = this . menuElement ? this . menuElement . nativeElement . clientHeight : 100 ;
184
184
const bodyWidth = event . view . document . body . clientWidth ;
185
185
const bodyHeight = event . view . document . body . clientHeight ;
186
186
const distanceFromRight = bodyWidth - ( event . clientX + menuWidth ) ;
You can’t perform that action at this time.
0 commit comments