Fix image path for non root owncloud instances
parent
05b9cc817a
commit
c3b095e677
|
@ -23,6 +23,7 @@ function emptyStr (obj) {
|
|||
|
||||
app.controller('WeatherController', ['$scope', '$interval', '$timeout', '$compile', '$http',
|
||||
function ($scope, $interval, $timeout, $compile, $http) {
|
||||
$scope.owncloudAppImgPath = '';
|
||||
$scope.userId = '';
|
||||
$scope.cities = [];
|
||||
$scope.showAddCity = false;
|
||||
|
@ -31,6 +32,7 @@ app.controller('WeatherController', ['$scope', '$interval', '$timeout', '$compil
|
|||
$scope.cityLoadError = '';
|
||||
$scope.currentCity = null;
|
||||
$scope.domCity = null;
|
||||
$scope.homeCity = '';
|
||||
|
||||
$scope.imageMapper = {
|
||||
"Clear": "sun.png",
|
||||
|
@ -50,6 +52,8 @@ app.controller('WeatherController', ['$scope', '$interval', '$timeout', '$compil
|
|||
}, 60000);
|
||||
|
||||
$timeout(function () {
|
||||
var imgPath = OC.generateUrl('/apps/weather').replace('index.php/','');
|
||||
$scope.owncloudAppImgPath = imgPath;
|
||||
$scope.loadCities();
|
||||
});
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<div id="city-right" ng-show="cityLoadError != ''">
|
||||
<span class="city-load-error">{{ cityLoadError }}</span>
|
||||
</div>
|
||||
<div id="city-right" ng-show="currentCity != null" style="background-image: url('/apps/weather/img/{{ currentCity.image }}');">
|
||||
<div id="city-right" ng-show="currentCity != null" style="background-image: url('{{ owncloudAppImgPath }}/img/{{ currentCity.image }}');">
|
||||
<div id="city-weather-panel">
|
||||
<div class="city-name">{{ currentCity.name }}, {{ currentCity.sys.country }}</div>
|
||||
<div class="city-current-temp">{{ currentCity.main.temp }}°C</div>
|
||||
|
|
Loading…
Reference in New Issue