[SOLVED] Help modifying backoffice. works localy b...
# help-with-umbraco
m
I am trying to make a small change to add my company's logo to the backoffice and run a small JS script. It seems to work fine locally but once deployed up to prod it just does not fire at all. Can anyone see if I am doing something wrong? Here is the JS code:
Copy code
(function () {
    'use strict';

    function loader(eventsService)
    {

        eventsService.on('app.ready', function ()
        {
            window.localStorage.plausible_ignore == "true";
            insertLogo();
        });

        function insertLogo() {
            var header = angular.element(document)
                .find('.umb-app-header');

            if (header != null && header.length == 1)
            {
                var item = document.createElement('img');
                item.src = '/App_Plugins/GameInfoSites/GameInfoSitesLogo.png';
                item.style.paddingRight = '15px';
                header[0].prepend(item);
            }
        }
    }

    angular.module('umbraco').run(loader);

})();
And here is my package.manifest conifg:
Copy code
{
  "name": "GameInfoSites",
  "version": "1.0.0",
  "allowPackageTelemetry": true,
  "bundleOptions": "Default",
  "javascript": [
    "/App_Plugins/GameInfoSites/BackOffice.js"
  ]
}
Can anyone see what I might be doing wrong?
d
You may be experiencing issues with minification. Angularjs dependency injection relies on the names of the parameters of your function
You might fix this by adding this line in your code snippet:
Copy code
loader.$inject = ['eventsService']
m
Thanks. I will gave that a shot after work and report back
a
What are the JS errors? For instance if you're using
dotnet publish
or DevOps to push changes to your live site, you might have to do something extra to ensure your assets are also included when creating a release for the live site.
m
I ran off to work and forgot to copuy the error but after adding what @D_Inventor suggested it is working now.
12 Views