Jelajahi Sumber

removed button and recovered [ view source ] for mobile

Jaume Sanchez 9 tahun lalu
induk
melakukan
6758d52460
1 mengubah file dengan 15 tambahan dan 42 penghapusan
  1. 15 42
      examples/index.html

+ 15 - 42
examples/index.html

@@ -87,12 +87,6 @@
 				overflow: auto;
 			}
 
-			.action-panel{
-				position: fixed;
-				bottom: 20px;
-				right: 20px;
-			}
-
 			.action-button {
 				padding: 8px;
 				color: #fff;
@@ -100,6 +94,9 @@
 				opacity: 0.7;
 				float: left;
 				margin-left: 1px;
+				position: fixed;
+				bottom: 20px;
+				right: 20px;
 			}
 			
 			.action-button:hover {
@@ -107,13 +104,6 @@
 				opacity: 1;
 			}
 
-			#open-external-button{
-				background-image: url(files/external.svg);
-				background-size: 50%;
-				background-position: 50% 50%;
-				background-repeat: no-repeat;
-			}
-
 			.filterBlock{
 				margin: 20px;
 				position: relative;
@@ -283,10 +273,6 @@
 		var container = document.createElement( 'div' );
 		content.appendChild( container );
 
-		var actionPanel = document.createElement( 'div' );
-		actionPanel.className = 'action-panel';
-		document.body.appendChild( actionPanel );
-
 		var button = document.createElement( 'div' );
 		button.className = 'action-button';
 		button.id = 'button';
@@ -297,20 +283,7 @@
 
 		}, false );
 		button.style.display = 'none';
-		actionPanel.appendChild( button );
-
-		var button2 = document.createElement( 'a' );
-		button2.className = 'action-button';
-		button2.id = 'open-external-button';
-		button2.innerHTML = '  '
-		button2.addEventListener( 'click', function ( event ) {
-
-			window.open( selected + '.html' );
-			event.preventDefault();
-
-		}, false );
-		button2.style.display = 'none';
-		actionPanel.appendChild( button2 );
+		document.body.appendChild( button );
 
 		var links = {};
 		var selected = null;
@@ -339,10 +312,7 @@
 
 						if ( event.button === 0 ) {
 
-							//event.preventDefault();
-
-							panel.classList.toggle( 'collapsed' );
-							//load( file );
+							selectFile( file );
 
 						}
 
@@ -359,22 +329,25 @@
 
 		var load = function ( file ) {
 
+			selectFile( file );
+			viewer.src = file + '.html';
+
+		};
+
+		var selectFile = function( file ) {
+
 			if ( selected !== null ) links[ selected ].className = 'link';
 
 			links[ file ].className = 'link selected';
 
 			window.location.hash = file;
-			viewer.src = file + '.html';
-			viewer.focus();
 
 			button.style.display = '';
-			button2.style.display = '';
-
+			panel.classList.toggle( 'collapsed' );
+			
 			selected = file;
 
-			button2.href = selected + '.html'
-
-		};
+		}
 
 		if ( window.location.hash !== '' ) {