Some more small changes to the embed dialog
This commit is contained in:
@@ -4,16 +4,22 @@
|
||||
$scope.height = 300;
|
||||
$scope.constrain = true;
|
||||
$scope.preview = "";
|
||||
|
||||
$scope.success = false;
|
||||
|
||||
$scope.preview = function () {
|
||||
if ($scope.url != "") {
|
||||
$scope.success = false;
|
||||
|
||||
$http({ method: 'POST', url: '/umbraco/UmbracoApi/Embed/Embed', params: { url: $scope.url, width: $scope.width, height: $scope.height } })
|
||||
.success(function (data) {
|
||||
$scope.preview = data.Markup;
|
||||
})
|
||||
.error(function () {
|
||||
$http({ method: 'POST', url: '/umbraco/UmbracoApi/Embed/Embed', params: { url: $scope.url, width: $scope.width, height: $scope.height } })
|
||||
.success(function(data) {
|
||||
$scope.preview = data.Markup;
|
||||
$scope.success = true;
|
||||
})
|
||||
.error(function() {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="umb-panel-header">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar">
|
||||
<input type="button" ng-click="insert()" class="btn btn-primary" value="Insert" />
|
||||
<input type="button" ng-click="insert()" class="btn btn-primary" value="Insert" ng-disabled="!success" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user