Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

disable drop under CSP #1958

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/select-multiple.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
aria-expanded="{{$select.open}}"
aria-label="{{$select.baseTitle}}"
ng-class="{'spinner': $select.refreshing}"
ondrop="return false;">
data-disallow-drop=data-disallow-drop>
</div>
<div ng-show="$select.open && $select.items.length > 0" class="ui-select-dropdown dropdown-menu">
<div class="ui-select-header"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/select2/select-multiple.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
ng-model="$select.search"
ng-click="$select.activate()"
style="width: 34px;"
ondrop="return false;">
data-disallow-drop=data-disallow-drop>
</li>
</ul>
<div class="ui-select-dropdown select2-drop select2-with-searchbox select2-drop-active"
Expand Down
2 changes: 1 addition & 1 deletion src/selectize/select-multiple.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ng-disabled="$select.disabled"
aria-expanded="{{$select.open}}"
aria-label="{{ $select.baseTitle }}"
ondrop="return false;">
data-disallow-drop=data-disallow-drop>
</div>
<div ng-show="$select.open" class="ui-select-dropdown selectize-dropdown"
ng-class="{'single': !$select.multiple, 'multi': $select.multiple}">
Expand Down
4 changes: 4 additions & 0 deletions src/uiSelectSortDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ uis.directive('uiSelectSort', ['$timeout', 'uiSelectConfig', 'uiSelectMinErr', f
}
});

if (element.data('disallowDrop')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than overriding the drop handlers in the html, simply don't set them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? as I don't see anything in the code that is looking for ondrop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because the browser does it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right. then we are good to go here 👍

return;
}

element.on('dragstart', function(event) {
element.addClass(draggingClassName);

Expand Down