Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves sui shortcode registration outside of domready function to prev… #823

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 2 additions & 11 deletions css/shortcode-ui.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/shortcode-ui.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions js/build/shortcode-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,22 +363,22 @@ var sui = require('./utils/sui.js'),
wp = (typeof window !== "undefined" ? window['wp'] : typeof global !== "undefined" ? global['wp'] : null),
$ = (typeof window !== "undefined" ? window['jQuery'] : typeof global !== "undefined" ? global['jQuery'] : null);

$(document).ready(function(){
// Create collection of shortcode models from data.
sui.shortcodes.add( shortcodeUIData.shortcodes );

// Create collection of shortcode models from data.
sui.shortcodes.add( shortcodeUIData.shortcodes );
wp.media.view.MediaFrame.Post = mediaFrame;

wp.media.view.MediaFrame.Post = mediaFrame;
// Register a view for each shortcode.
sui.shortcodes.each( function( shortcode ) {
if ( wp.mce.views ) {
wp.mce.views.register(
shortcode.get('shortcode_tag'),
shortcodeViewConstructor
);
}
} );

// Register a view for each shortcode.
sui.shortcodes.each( function( shortcode ) {
if ( wp.mce.views ) {
wp.mce.views.register(
shortcode.get('shortcode_tag'),
shortcodeViewConstructor
);
}
} );
$(function(){

$(document.body).on( 'click', '.shortcake-add-post-element', function( event ) {

Expand All @@ -397,7 +397,7 @@ $(document).ready(function(){
// Remove focus from the `.shortcake-add-post-element` button.
// Prevents Opera from showing the outline of the button above the modal.
// See: https://core.trac.wordpress.org/ticket/22445
$el.blur();
$el.trigger('blur');

if ( frame ) {
frame.mediaController.setActionSelect();
Expand Down
28 changes: 14 additions & 14 deletions js/src/shortcode-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ var sui = require('sui-utils/sui'),
wp = require('wp'),
$ = require('jquery');

$(document).ready(function(){
// Create collection of shortcode models from data.
sui.shortcodes.add( shortcodeUIData.shortcodes );

// Create collection of shortcode models from data.
sui.shortcodes.add( shortcodeUIData.shortcodes );
wp.media.view.MediaFrame.Post = mediaFrame;

wp.media.view.MediaFrame.Post = mediaFrame;
// Register a view for each shortcode.
sui.shortcodes.each( function( shortcode ) {
if ( wp.mce.views ) {
wp.mce.views.register(
shortcode.get('shortcode_tag'),
shortcodeViewConstructor
);
}
} );

// Register a view for each shortcode.
sui.shortcodes.each( function( shortcode ) {
if ( wp.mce.views ) {
wp.mce.views.register(
shortcode.get('shortcode_tag'),
shortcodeViewConstructor
);
}
} );
$(function(){

$(document.body).on( 'click', '.shortcake-add-post-element', function( event ) {

Expand All @@ -39,7 +39,7 @@ $(document).ready(function(){
// Remove focus from the `.shortcake-add-post-element` button.
// Prevents Opera from showing the outline of the button above the modal.
// See: https://core.trac.wordpress.org/ticket/22445
$el.blur();
$el.trigger('blur');

if ( frame ) {
frame.mediaController.setActionSelect();
Expand Down
Loading