Skip to content

Commit

Permalink
Add new ngeo-draggable-handle option to modalComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
fredj committed Feb 11, 2019
1 parent 1b77c8c commit ddcdcbf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/message/modalComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const module = angular.module('ngeoModal', []);
*
* See our live example: [../examples/modal.html](../examples/modal.html)
*
* @htmlAttribute {string} ngeo-draggable-handle The jquery selector that define the element
* that can starts the dragging sequence. Defaults to ``.
* @htmlAttribute {boolean} ngeo-modal-resizable Whether the modal can be
* resized or not. Defaults to `false`.
* @htmlAttribute {boolean} ngeo-modal-closable Whether the modal can be
Expand All @@ -58,6 +60,7 @@ const messageModalComponent = {
transclude: true,
controller: 'ngeoModalController',
bindings: {
'draggableHandle': '=?ngeodraggableHandle',
'resizable': '<ngeoModalResizable',
'closable': '<ngeoModalClosable'
}
Expand Down Expand Up @@ -94,6 +97,11 @@ class Controller {
*/
this.modal_;

/**
* @type {string}
*/
this.draggableHandle;

/**
* @type {boolean}
*/
Expand Down Expand Up @@ -123,7 +131,9 @@ class Controller {
this.resizable = !!this.resizable;

const dialog = this.modal_.find('.modal-dialog');
dialog.draggable();
dialog.draggable({
handle: this.draggableHandle || '.modal-header'
});
if (this.resizable) {
dialog.resizable();
}
Expand Down

0 comments on commit ddcdcbf

Please sign in to comment.