{"action":"opened","issue":{"url":"https://api.github.com/repos/Reklino/angular-resizable/issues/41","labels_url":"https://api.github.com/repos/Reklino/angular-resizable/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/Reklino/angular-resizable/issues/41/comments","events_url":"https://api.github.com/repos/Reklino/angular-resizable/issues/41/events","html_url":"https://github.com/Reklino/angular-resizable/issues/41","id":125273426,"number":41,"title":"Add minimum width/height options","user":{"login":"guikubivan","id":194133,"avatar_url":"https://avatars.githubusercontent.com/u/194133?v=3","gravatar_id":"","url":"https://api.github.com/users/guikubivan","html_url":"https://github.com/guikubivan","followers_url":"https://api.github.com/users/guikubivan/followers","following_url":"https://api.github.com/users/guikubivan/following{/other_user}","gists_url":"https://api.github.com/users/guikubivan/gists{/gist_id}","starred_url":"https://api.github.com/users/guikubivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guikubivan/subscriptions","organizations_url":"https://api.github.com/users/guikubivan/orgs","repos_url":"https://api.github.com/users/guikubivan/repos","events_url":"https://api.github.com/users/guikubivan/events{/privacy}","received_events_url":"https://api.github.com/users/guikubivan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-06T22:02:57Z","updated_at":"2016-01-06T22:02:57Z","closed_at":null,"body":"I tried to implement this with the following. I'm not familiar with flexbox so I ignored that, but something along these lines would be great.\r\n<pre>\r\n            scope: {\r\n                rDirections: \"=\",\r\n                rCenteredX: \"=\",\r\n                rCenteredY: \"=\",\r\n                rWidth: \"=\",\r\n                rHeight: \"=\",\r\n                rFlex: \"=\",\r\n                rGrabber: \"@\",\r\n                rMinWidth: \"=\",\r\n                rMinHeight: \"=\"\r\n            }\r\n....\r\n\r\nswitch(dragDir) {\r\n                        case 'top':\r\n                            var newHeight = h + (offset * vy);\r\n                            if(scope.rFlex) { element[0].style.flexBasis = newHeight + 'px'; }\r\n                            else {            if(!scope.rMinHeight || ( newHeight > scope.rMinHeight)) { element[0].style.height = newHeight + 'px'; } }\r\n                            break;\r\n                        case 'right':\r\n                            var newWidth = w - (offset * vx);\r\n                            if(scope.rFlex) { element[0].style.flexBasis = newWidth + 'px'; }\r\n                            else {            if(!scope.rMinWidth || ( newWidth > scope.rMinWidth)) { element[0].style.width = newWidth + 'px'; } }\r\n                            break;\r\n                        case 'bottom':\r\n                            var newHeight = h - (offset * vy);\r\n                            if(scope.rFlex) { element[0].style.flexBasis = h - (offset * vy) + 'px'; }\r\n                            else {            if(!scope.rMinHeight || ( newHeight > scope.rMinHeight)) { element[0].style.height = h - (offset * vy) + 'px'; } }\r\n                            break;\r\n                        case 'left':\r\n                            var newWidth = w + (offset * vx);\r\n                            if(scope.rFlex) { element[0].style.flexBasis = newWidth + 'px'; }\r\n                            else {            if(!scope.rMinWidth || ( newWidth > scope.rMinWidth)) { element[0].style.width = newWidth + 'px';} }\r\n                            break;\r\n                    }\r\n</pre>"}}