user overlayService for template picker to fix bug with nested position relatve/fixed
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function GridSelector() {
|
||||
function GridSelector(overlayService) {
|
||||
|
||||
function link(scope, el, attr, ctrl) {
|
||||
|
||||
@@ -33,25 +33,26 @@
|
||||
};
|
||||
|
||||
scope.openItemPicker = function($event){
|
||||
scope.dialogModel = {
|
||||
var dialogModel = {
|
||||
view: "itempicker",
|
||||
title: "Choose " + scope.itemLabel,
|
||||
availableItems: scope.availableItems,
|
||||
selectedItems: scope.selectedItems,
|
||||
position: "target",
|
||||
event: $event,
|
||||
show: true,
|
||||
submit: function(model) {
|
||||
scope.selectedItems.push(model.selectedItem);
|
||||
|
||||
// if no default item - set item as default
|
||||
if(scope.defaultItem === null) {
|
||||
scope.setAsDefaultItem(model.selectedItem);
|
||||
}
|
||||
|
||||
scope.dialogModel.show = false;
|
||||
scope.dialogModel = null;
|
||||
overlayService.close();
|
||||
},
|
||||
close: function() {
|
||||
overlayService.close();
|
||||
}
|
||||
};
|
||||
overlayService.open(dialogModel);
|
||||
};
|
||||
|
||||
scope.setAsDefaultItem = function(selectedItem) {
|
||||
|
||||
@@ -33,11 +33,4 @@
|
||||
<small><localize key="general_all">Akk</localize> {{itemLabel}}s <localize key="grid_areAdded">are added</localize></small>
|
||||
</div>
|
||||
|
||||
<umb-overlay
|
||||
ng-if="dialogModel.show"
|
||||
model="dialogModel"
|
||||
position="target"
|
||||
view="dialogModel.view">
|
||||
</umb-overlay>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user