+ any = ($this.
+ closest('.selectable-container').
+ find('.selectable.active').length > 0)
+ $this.
+ closest('.modal').
+ find('[data-enable-if-selection]').
+ prop('disabled', !any);
+
+ if ($this.hasClass('active')) {
+ $(".modal-dialog-preview-pane").html('<div class="spinner spinner-32px spinner-h-center spinner-v-center"></div>');
+ $.ajax($this.attr('data-preview-href'),
+ {dataType: "html"}).
+ done(function(data, status, jqxhr) {
+ $(".modal-dialog-preview-pane").html(data);
+ }).
+ fail(function(data, status, jqxhr) {
+ $(".modal-dialog-preview-pane").text('Preview load failed.');
+ });
+ }
+