Skip to content

Commit ac7f92d

Browse files
committed
Merge branch 'develop'
2 parents 58ff050 + 1900aeb commit ac7f92d

File tree

5 files changed

+48
-20
lines changed

5 files changed

+48
-20
lines changed

app/assets/javascripts/ckeditor/plugins/cortex_media_insert/plugin.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,16 @@
4949

5050
editor.addCommand('insertMedia', {
5151
exec: function (editor) {
52-
window.MODALS.wysiwyg.open();
52+
global.blur_backdrop();
53+
global.dialogs.wysiwyg.showModal();
5354

5455
global.media_select = {};
5556
global.media_select_defer = $.Deferred();
5657
global.media_select_defer.promise(global.media_select);
5758

5859
global.media_select.done(function (media) {
59-
window.MODALS.wysiwyg.close();
60+
global.unblur_backdrop();
61+
global.dialogs.wysiwyg.close();
6062

6163
editor.execCommand('media', {
6264
startupData: {
Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1-
$('.media-select--featured').click(function (elem) {
2-
var id = $(this).data().id;
3-
var title = $(this).data().title;
4-
var thumb_url = $(this).data().thumb;
1+
(function (global) {
2+
'use strict';
53

6-
$(".association_content_item_id").val(id);
4+
$("#featured-button__select").on("click", function (event) {
5+
event.preventDefault();
6+
global.blur_backdrop();
7+
global.dialogs.featured.showModal();
8+
});
79

8-
$('.content-item-button__selection').remove();
9-
$('.content-item-button').append(
10-
'<div class="content-item-button__selection">' +
11-
'<img src="' + thumb_url + '" height="50px">' +
12-
'<div class="content-item-button__selection__text">' +
13-
'Selected Media: ' +
14-
title +
15-
'</div></div>'
16-
);
10+
$('.media-select--featured').click(function (elem) {
11+
var id = $(this).data().id;
12+
var title = $(this).data().title;
13+
var thumb_url = $(this).data().thumb;
1714

18-
window.MODALS.featured.close();
19-
});
15+
$(".association_content_item_id").val(id);
16+
17+
$('.content-item-button__selection').remove();
18+
$('.content-item-button').append(
19+
'<div class="content-item-button__selection">' +
20+
'<img src="' + thumb_url + '" height="50px">' +
21+
'<div class="content-item-button__selection__text">' +
22+
'Selected Media: ' +
23+
title +
24+
'</div></div>'
25+
);
26+
27+
global.unblur_backdrop();
28+
global.dialogs.featured.close();
29+
});
30+
}(this));
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(function (global) {
2+
'use strict';
3+
4+
$('.media-select--wysiwyg').on("click", function (event) {
5+
event.preventDefault();
6+
var element = $(this),
7+
id = element.data().id,
8+
title = element.data().title,
9+
url = element.data().url,
10+
alt = element.data().alt,
11+
asset_type = element.data().assetType;
12+
13+
media_select_defer.resolve({id: id, title: title, url: url, alt: alt, asset_type: asset_type});
14+
});
15+
}(this));

app/cells/plugins/core/content_item/popup.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
= render_label
55
%br
6-
%button.content-item-button.popup--open
6+
%button.content-item-button#featured-button__select
77
.content-item-button__select.content-item-button__select--selected
88
%i{ class: "material-icons icon" }
99
cloud_upload

lib/cortex/plugins/core/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Cortex
22
module Plugins
33
module Core
4-
VERSION = '0.9.1'
4+
VERSION = '0.10.0'
55
end
66
end
77
end

0 commit comments

Comments
 (0)