diff --git a/assets/js/src/models/media-collection.js b/assets/js/src/models/media-collection.js index c2a89a74..cebb5f3f 100644 --- a/assets/js/src/models/media-collection.js +++ b/assets/js/src/models/media-collection.js @@ -264,14 +264,14 @@ var MediaCollection = Backbone.Collection.extend({ return fallback.sync.apply(this, arguments); }, - fetchFail: function () { + fetchFail: function (response, textStatus) { if (this.pageNumber > 1) { this.pageNumber--; } wpbc.broadcast.trigger('fetch:finished'); wpbc.broadcast.trigger('spinner:off'); - wpbc.broadcast.trigger('fetch:apiError'); - if (status === 'abort') { + if (textStatus !== 'abort') { + wpbc.broadcast.trigger('fetch:apiError'); } }, diff --git a/includes/admin/class-bc-admin-menu.php b/includes/admin/class-bc-admin-menu.php index bff41251..1399b559 100644 --- a/includes/admin/class-bc-admin-menu.php +++ b/includes/admin/class-bc-admin-menu.php @@ -31,8 +31,8 @@ public function register_admin_menu() { add_submenu_page( 'brightcove', esc_html__( 'Brightcove Labels', 'brightcove' ), esc_html__( 'Labels', 'brightcove' ), 'manage_options', 'brightcove-labels', array( $this, 'render_labels_page' ) ); // These have no parent menu slug so they don't appear in the menu - add_submenu_page( null, esc_html__( 'Add Source', 'brightcove' ), esc_html__( 'Add Source', 'brightcove' ), 'manage_options', 'page-brightcove-edit-source', array( $this, 'render_edit_source_page' ) ); - add_submenu_page( null, esc_html__( 'Edit Label', 'brightcove' ), esc_html__( 'Edit Label', 'brightcove' ), 'manage_options', 'page-brightcove-edit-label', array( $this, 'render_edit_label_page' ) ); + add_submenu_page( '', esc_html__( 'Add Source', 'brightcove' ), esc_html__( 'Add Source', 'brightcove' ), 'manage_options', 'page-brightcove-edit-source', array( $this, 'render_edit_source_page' ) ); + add_submenu_page( '', esc_html__( 'Edit Label', 'brightcove' ), esc_html__( 'Edit Label', 'brightcove' ), 'manage_options', 'page-brightcove-edit-label', array( $this, 'render_edit_label_page' ) ); remove_submenu_page( 'brightcove', 'brightcove' ); }