Issue #164 - Open for edit option in open tour dialog

This commit is contained in:
Ron Gilchrist 2019-04-17 15:58:55 -07:00
Родитель 66d8f1c6a9
Коммит fbb65f1ded
3 изменённых файлов: 28 добавлений и 13 удалений

Просмотреть файл

@ -763,17 +763,13 @@ wwt.controllers.controller('MainController',
});
};
$scope.playTour = function (url) {
util.goFullscreen();
console.log(encodeURIComponent(url));
$scope.playTour = function (url, edit) {
console.log(edit,url);
if (!edit) {
util.goFullscreen();
}
//console.log(encodeURIComponent(url));
$('.finder-scope').hide();
wwtlib.WWTControl.singleton.playTour(url);
$scope.$applyAsync(function () {
wwt.tourPlaying = $rootScope.tourPlaying = true;
$rootScope.tourPaused = false;
});
wwt.wc.add_tourEnded(tourChangeHandler);
wwt.wc.add_tourReady(function () {
$scope.$applyAsync(function () {
@ -782,8 +778,17 @@ wwt.controllers.controller('MainController',
$scope.ribbon.tabs[1].menu['Edit Tour'] = [$scope.editTour];
});
if (edit){
$scope.editTour();
}
});
wwtlib.WWTControl.singleton.playTour(url);
$scope.$applyAsync(function () {
wwt.tourPlaying = $rootScope.tourPlaying = true;
$rootScope.tourPaused = edit;
});
wwt.wc.add_tourEnded(tourChangeHandler);
//wwt.wc.add_tourPaused(tourChangeHandler);
};

Просмотреть файл

@ -13,6 +13,7 @@
$('#txtOpenItem').focus();
}, 100);
});
$scope.tour={edit:false};
$scope.openItem = function () {
var itemType = $rootScope.openType;
@ -24,7 +25,8 @@
$('#openModal').modal('hide');
});
} else if (itemType === 'tour') {
$scope.playTour($scope.openItemUrl);
console.log({editTour:$scope.tour.edit});
$scope.playTour($scope.openItemUrl, !!$scope.tour.edit);
$('#openModal').modal('hide');
} else if (itemType === 'FITS image') {
wwt.wc.loadFits($scope.openItemUrl);
@ -63,7 +65,6 @@
$scope.openItemUrl = mediaResult.url;
$scope.openItem();
});
};
$scope.astrometryStatusText = '';

Просмотреть файл

@ -14,11 +14,20 @@
<input type="url" class="form-control" ng-model="openItemUrl" id="txtOpenItem"
placeholder="Enter {{openType}} url" ng-disabled="imageFail">
</div>
<div ng-if="openType=='tour'" class="pull-right">
<div class="checkbox">
<label data-ng-class="tour.edit ? 'checked' : ''">
<input type="checkbox" ng-model="tour.edit" />
<span localize="Open for edit"></span>
</label>
</div>
</div>
<div ng-if="openType != 'image'">
<p localize="Or"></p>
<a class="btn" localize="Choose local file" href="#" onclick="$('#addFile')[0].click()"/>
<input type="file" id="addFile" onchange="angular.element(this).scope().mediaFileChange(event)"/>
</div>
<div ng-show="imageFail">
<hr/>
<div ng-switch="importState">