From 8eb07963ec17b00140f27b13f4cbcaf4f24c8cda Mon Sep 17 00:00:00 2001 From: Tim Geyssens Date: Wed, 18 Sep 2013 14:52:03 +0200 Subject: [PATCH] Update to the embed rte plugin, adds code that makes the resize work --- .../common/dialogs/rteembed.controller.js | 24 ++++++++++++++++++- .../src/views/common/dialogs/rteembed.html | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js index 99f464d224..3f0995b79e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js @@ -5,7 +5,9 @@ $scope.constrain = true; $scope.preview = ""; $scope.success = false; - + + var origWidth = 500; + var origHeight = 300; $scope.showPreview = function(){ if ($scope.url != "") { @@ -26,6 +28,26 @@ }; + $scope.changeSize = function (type) { + var width, height; + + if ($scope.constrain) { + width = parseInt($scope.width, 10); + height = parseInt($scope.height, 10); + if (type == 'width') { + origHeight = Math.round((width / origWidth) * height); + $scope.height = origHeight; + } else { + origWidth = Math.round((height / origHeight) * width); + $scope.width = origWidth; + } + } + if ($scope.url != "") { + $scope.showPreview(); + } + + }; + $scope.insert = function(){ $scope.submit($scope.preview); }; diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html index 5fc7450c20..71169adcc2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html @@ -16,7 +16,7 @@ - x + x