Skip to content

Commit c8e916b

Browse files
committed
moved broadcast
1 parent cf47a66 commit c8e916b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/js/mdKeyboard.provider.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ function MdKeyboardProvider($$interimElementProvider, keyboardLayouts, keyboardD
7979
function useLayout(layout) {
8080
if (LAYOUTS[layout]) {
8181
CURRENT_LAYOUT = layout;
82-
//console.log($injector.get('$rootScope'), $injector.get('$scope'));
83-
//$rootScope = $injector.get('$rootScope');
84-
//$rootScope.$broadcast('$mdKeyboardLayoutChanged', layout);
82+
// broadcast new layout
83+
if (SCOPE) {
84+
SCOPE.$broadcast('$mdKeyboardLayoutChanged', CURRENT_LAYOUT);
85+
}
8586
} else {
8687
if (layout.length) {
8788
var msg = "" +
@@ -91,10 +92,6 @@ function MdKeyboardProvider($$interimElementProvider, keyboardLayouts, keyboardD
9192
console.warn(msg);
9293
}
9394
}
94-
// broadcast new layout
95-
if (SCOPE) {
96-
SCOPE.$broadcast('$mdKeyboardLayoutChanged', CURRENT_LAYOUT);
97-
}
9895
}
9996

10097
// add a custom layout

0 commit comments

Comments
 (0)