Commit ee2d6021 authored by KR Moorhouse's avatar KR Moorhouse Committed by GitHub

Merge pull request #3597 from wpninjas/action-drawer-modals

Action drawer modals
parents 8bec0dd7 55337b75
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -14,9 +14,6 @@ define( [], function() {
template: '#tmpl-nf-drawer-action-type-button',
onRender: function() {
this.$el = this.$el.children();
this.$el.unwrap();
this.setElement( this.$el );
jQuery( this.el ).disableSelection();
......@@ -52,7 +49,20 @@ define( [], function() {
if ( 'installed' == this.model.get( 'section' ) ) { // Is this an installed action?
nfRadio.channel( 'actions' ).trigger( 'click:addAction', this.model );
} else { // This isn't an installed action
window.open( this.model.get( 'link' ), '_blank' );
var modalContent = this.model.get( 'modal_content' );
var actionModal = new jBox( 'Modal', {
content: modalContent,
zIndex:99999999,
closeButton: 'box',
overlay: true,
width: 600,
repositionOnOpen: true,
reposition: true
});
actionModal.open();
// window.open( this.model.get( 'link' ), '_blank' );
}
}
},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -314,3 +314,39 @@
}
}
}
.available-action-modal {
padding: 20px;
img {
width: 100%;
}
iframe {
width: 100%;
height: 214px;
}
p:first-of-type {
font-size: 16px;
font-weight: bold;
line-height: 20px;
padding: 16px 40px;
text-align: center;
}
.actions {
margin-top: 30px;
&::after {
display: block;
clear: both;
content: "";
}
}
.primary.nf-button {
float: right;
}
ul {
list-style-type: disc;
li {
margin-left: 20px;
padding-left: 10px;
}
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -507,6 +507,7 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
$nicename = ( isset( $action[ 'nicename' ] ) ) ? $action[ 'nicename' ] : '';
$image = ( isset( $action[ 'image' ] ) ) ? $action[ 'image' ] : '';
$link = ( isset( $action[ 'link' ] ) ) ? $action[ 'link' ] : '';
$modal_content = ( isset( $action[ 'modal_content' ] ) ) ? $action[ 'modal_content' ] : '';
if ( $u_id ) {
$last_slash = strripos( $link, '/' );
......@@ -523,6 +524,7 @@ final class NF_Admin_Menus_Forms extends NF_Abstracts_Menu
'nicename' => $nicename,
'image' => $image,
'link' => $link,
'modal_content' => $modal_content,
'settingGroups' => array(),
'settingDefaults' => array()
);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment