Some more small changes to the embed dialog

This commit is contained in:
Tim Geyssens
2013-09-13 14:13:58 +02:00
parent d3f1d6bb6b
commit 2a16e05699
2 changed files with 14 additions and 8 deletions

View File

@@ -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() {
});
});
}
};

View File

@@ -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>