Skip to content

Commit

Permalink
Merge pull request #641 from ahasnawi/app-context-width-height
Browse files Browse the repository at this point in the history
add initialHeight, initialWidth and navbarEnabled properties to app c…
  • Loading branch information
ahasnawi authored Jan 18, 2022
2 parents 27760ef + aa2c73c commit 9cdcd47
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
6 changes: 6 additions & 0 deletions pluginTester/pages/controllers/shellAppCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ $app.controller('shellAppCtrl', ['$rootScope', '$scope', '$routeParams', '$sce',
$scope.loadWebpackFrames = function(config) {
var root = window.location.protocol + '//' + window.location.hostname + ':' + config.webpack;
postMaster.widgetPluginAPI.getContext(null, function(err, context){
var widgetFrame = document.querySelector("#widget");
context.initialWidth = widgetFrame.clientWidth;
context.initialHeight = widgetFrame.clientHeight;
var contextQueryParameter = 'appcontext=' + encodeURIComponent(JSON.stringify(context));
$scope.widgetSrc = root + '/widget/index.html?fid=widget&' + contextQueryParameter;

Expand All @@ -67,6 +70,9 @@ $app.controller('shellAppCtrl', ['$rootScope', '$scope', '$routeParams', '$sce',
$scope.loadFrames = function (pluginFolder, config) {
var root = '../plugins/';
postMaster.widgetPluginAPI.getContext(null, function(err, context){
var widgetFrame = document.querySelector("#widget");
context.initialWidth = widgetFrame.clientWidth;
context.initialHeight = widgetFrame.clientHeight;
var contextQueryParameter = 'appcontext=' + encodeURIComponent(JSON.stringify(context));
$scope.widgetSrc = root + pluginFolder + '/widget/index.html?fid=widget&' + contextQueryParameter;

Expand Down
Loading

0 comments on commit 9cdcd47

Please sign in to comment.