Index: wp-admin/js/wp-fullscreen.js
===================================================================
--- wp-admin/js/wp-fullscreen.js	(revision 22872)
+++ wp-admin/js/wp-fullscreen.js	(working copy)
@@ -482,14 +482,8 @@
 	}
 
 	api.medialib = function() {
-		if ( s.has_tinymce && 'tinymce' === s.mode ) {
-			tinyMCE.execCommand('WP_Medialib');
-		} else {
-			var href = $('#wp-' + s.editor_id + '-media-buttons a.thickbox').attr('href') || '';
-
-			if ( href )
-				tb_show('', href);
-		}
+		if ( typeof wp !== 'undefined' && wp.media && wp.media.editor )
+			wp.media.editor.open(s.editor_id);
 	}
 
 	api.refresh_buttons = function( fade ) {
Index: wp-includes/css/editor.css
===================================================================
--- wp-includes/css/editor.css	(revision 22872)
+++ wp-includes/css/editor.css	(working copy)
@@ -1148,7 +1148,7 @@
 	padding: 2px;
 	position: absolute;
 	display: none;
-	z-index: 999998;
+	z-index: 100000;
 }
 
 #wp_editimgbtn,
Index: wp-includes/css/media-views.css
===================================================================
--- wp-includes/css/media-views.css	(revision 22872)
+++ wp-includes/css/media-views.css	(working copy)
@@ -68,7 +68,7 @@
 	left: 40px;
 	right: 40px;
 	bottom: 40px;
-	z-index: 125000;
+	z-index: 160000;
 }
 
 .media-modal-backdrop {
@@ -79,7 +79,7 @@
 	bottom: 0;
 	background: #000;
 	opacity: 0.8;
-	z-index: 120000;
+	z-index: 159900;
 }
 
 .media-modal-backdrop div {
Index: wp-includes/js/media-editor.js
===================================================================
--- wp-includes/js/media-editor.js	(revision 22872)
+++ wp-includes/js/media-editor.js	(working copy)
@@ -471,10 +471,9 @@
 		},
 
 		init: function() {
-			$(document.body).on('click', '.insert-media', function( event ) {
+			$(document.body).on( 'click', '.insert-media', function( event ) {
 				var $this = $(this),
-					editor = $this.data('editor'),
-					workflow;
+					editor = $this.data('editor');
 
 				event.preventDefault();
 
@@ -485,22 +484,35 @@
 				// See: http://core.trac.wordpress.org/ticket/22445
 				$this.blur();
 
-				if ( ! _.isString( editor ) )
-					return;
+				wp.media.editor.open( editor );
+			});
+		},
 
-				workflow = wp.media.editor.get( editor );
+		open: function( id ) {
+			var workflow;
 
-				// If the workflow exists, just open it.
-				if ( workflow ) {
-					workflow.open();
-					return;
-				}
+			// If an empty `id` is provided, default to `wpActiveEditor`.
+			id = id || wpActiveEditor;
 
-				// Initialize the editor's workflow if we haven't yet.
-				wp.media.editor.add( editor );
-			});
+			// If that doesn't work, fall back to `tinymce.activeEditor`.
+			if ( ! id && typeof tinymce !== 'undefined' && tinymce.activeEditor )
+				id = id || tinymce.activeEditor.id;
+
+			// Last but not least, fall back to the empty string.
+			id = id || '';
+
+			workflow = wp.media.editor.get( id );
+
+			// If the workflow exists, open it.
+			// Initialize the editor's workflow if we haven't yet.
+			if ( workflow )
+				workflow.open();
+			else
+				workflow = wp.media.editor.add( id );
+
+			return workflow;
 		}
 	};
 
 	$( wp.media.editor.init );
-}(jQuery));
\ No newline at end of file
+}(jQuery));
Index: wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
===================================================================
--- wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js	(revision 22872)
+++ wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js	(working copy)
@@ -63,15 +63,8 @@
 			});
 
 			ed.addCommand('WP_Medialib', function() {
-				var id = ed.getParam('wp_fullscreen_editor_id') || ed.getParam('fullscreen_editor_id') || ed.id,
-					link = tinymce.DOM.select('#wp-' + id + '-media-buttons a.thickbox');
-
-				if ( link && link[0] )
-					link = link[0];
-				else
-					return;
-
-				tb_show('', link.href);
+				if ( typeof wp !== 'undefined' && wp.media && wp.media.editor )
+					wp.media.editor.open( ed.id );
 			});
 
 			// Register buttons
