File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 190
190
}
191
191
192
192
} ,
193
+ printClient : null ,
193
194
194
195
/**
195
196
* Constructor.
206
207
}
207
208
var element = widget . element ;
208
209
widget . elementUrl = Mapbender . configuration . application . urls . element + '/' + element . attr ( 'id' ) + '/' ;
210
+ var self = this ;
211
+ Mapbender . elementRegistry . waitReady ( '.mb-element-printclient' ) . then ( function ( printClient ) {
212
+ self . printClient = printClient ;
213
+ } , function ( ) {
214
+ self . printClient = false ;
215
+ } ) ;
209
216
Mapbender . elementRegistry . onElementReady ( widget . options . target , $ . proxy ( widget . _setup , widget ) ) ;
210
217
} ,
211
218
889
896
widget . currentPopup . popupDialog ( 'close' ) ;
890
897
}
891
898
892
- if ( schema . printable ) {
899
+ if ( schema . printable && this . printClient ) {
900
+ var printClient = this . printClient ;
893
901
var printButton = {
894
902
text : translate ( "feature.print" ) ,
895
903
click : function ( ) {
896
- var printWidget = $ ( '.mb-element-printclient' ) . data ( 'mapbenderMbPrintClient' ) ;
897
- if ( printWidget ) {
898
- var dialog = $ ( this ) . closest ( ".ui-dialog-content" ) ;
899
- var olFeature = dialog . data ( 'feature' ) ;
900
- printWidget . printDigitizerFeature ( olFeature , olFeature . schema . featureTypeName || olFeature . schema . schemaName ) ;
901
- } else {
902
- $ . notify ( "Druck element ist nicht verfügbar!" ) ;
903
- }
904
+ var dialog = $ ( this ) . closest ( ".ui-dialog-content" ) ;
905
+ var olFeature = dialog . data ( 'feature' ) ;
906
+ printClient . printDigitizerFeature ( olFeature , olFeature . schema . featureTypeName || olFeature . schema . schemaName ) ;
904
907
}
905
908
} ;
906
909
buttons . push ( printButton ) ;
You can’t perform that action at this time.
0 commit comments