mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-11-04 03:17:00 -05:00 
			
		
		
		
	Merge pull request #739 from jmt-gh/mobile_responsive_search
Show search bar on mobile responsive views (fix #715)
This commit is contained in:
		
						commit
						06582b5371
					
				@ -3,7 +3,7 @@
 | 
			
		||||
    <div id="appbar" class="absolute top-0 bottom-0 left-0 w-full h-full px-2 md:px-6 py-1 z-50">
 | 
			
		||||
      <div class="flex h-full items-center">
 | 
			
		||||
        <nuxt-link to="/">
 | 
			
		||||
          <img src="/icon48.png" class="w-10 h-10 md:w-12 md:h-12 mr-4" />
 | 
			
		||||
          <img src="/icon48.png" class="w-8 h-8 mr-8 sm:w-12 sm:h-12 sm:mr-4" />
 | 
			
		||||
        </nuxt-link>
 | 
			
		||||
 | 
			
		||||
        <nuxt-link to="/">
 | 
			
		||||
@ -12,7 +12,7 @@
 | 
			
		||||
 | 
			
		||||
        <ui-libraries-dropdown />
 | 
			
		||||
 | 
			
		||||
        <controls-global-search v-if="currentLibrary" class="hidden md:block" />
 | 
			
		||||
        <controls-global-search v-if="currentLibrary" class="" />
 | 
			
		||||
        <div class="flex-grow" />
 | 
			
		||||
 | 
			
		||||
        <span v-if="showExperimentalFeatures" class="material-icons text-4xl text-warning pr-0 sm:pr-2 md:pr-4">logo_dev</span>
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="w-80 ml-6 relative">
 | 
			
		||||
  <div class="sm:w-80 w-full sm:ml-6 relative">
 | 
			
		||||
    <form @submit.prevent="submitSearch">
 | 
			
		||||
      <ui-text-input ref="input" v-model="search" placeholder="Search.." @input="inputUpdate" @focus="focussed" @blur="blurred" class="w-full h-8 text-sm" />
 | 
			
		||||
    </form>
 | 
			
		||||
@ -7,7 +7,7 @@
 | 
			
		||||
      <span v-if="!search" class="material-icons" style="font-size: 1.2rem">search</span>
 | 
			
		||||
      <span v-else class="material-icons" style="font-size: 1.2rem">close</span>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div v-show="showMenu && (lastSearch || isTyping)" class="absolute z-40 -mt-px w-full bg-bg border border-black-200 shadow-lg rounded-md py-1 px-2 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm globalSearchMenu">
 | 
			
		||||
    <div v-show="showMenu && (lastSearch || isTyping)" class="absolute z-40 -mt-px w-40 sm:w-full bg-bg border border-black-200 shadow-lg rounded-md py-1 px-2 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm globalSearchMenu">
 | 
			
		||||
      <ul class="h-full w-full" role="listbox" aria-labelledby="listbox-label">
 | 
			
		||||
        <li v-if="isTyping" class="py-2 px-2">
 | 
			
		||||
          <p>Thinking...</p>
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,14 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div v-if="currentLibrary" class="relative w-36 h-8" v-click-outside="clickOutsideObj">
 | 
			
		||||
    <button type="button" :disabled="disabled" class="relative h-full w-full border border-white border-opacity-10 hover:border-opacity-20 rounded shadow-sm pl-3 pr-3 text-left focus:outline-none cursor-pointer bg-black bg-opacity-20 text-gray-400 hover:text-gray-200" aria-haspopup="listbox" aria-expanded="true" @click.stop.prevent="clickShowMenu">
 | 
			
		||||
      <span class="flex items-center">
 | 
			
		||||
        <widgets-library-icon :icon="currentLibraryIcon" class="mr-2" />
 | 
			
		||||
        <span class="block truncate text-sm">{{ currentLibrary.name }}</span>
 | 
			
		||||
  <div v-if="currentLibrary" class="relative sm:w-36 h-8 px-1.5" v-click-outside="clickOutsideObj">
 | 
			
		||||
    <button type="button" :disabled="disabled" class="w-10 sm:w-36 relative h-full border border-white border-opacity-10 hover:border-opacity-20 rounded shadow-sm px-2 text-left text-sm focus:outline-none cursor-pointer bg-black bg-opacity-20 text-gray-400 hover:text-gray-200" aria-haspopup="listbox" :aria-expanded="showMenu" @click.stop.prevent="clickShowMenu">
 | 
			
		||||
      <span class="flex items-center justify-center sm:justify-start">
 | 
			
		||||
        <widgets-library-icon :icon="currentLibraryIcon" class="sm:mr-2" />
 | 
			
		||||
        <span class="hidden sm:block">{{ currentLibrary.name }}</span>
 | 
			
		||||
      </span>
 | 
			
		||||
    </button>
 | 
			
		||||
 | 
			
		||||
    <transition name="menu">
 | 
			
		||||
      <ul v-show="showMenu" class="absolute z-10 -mt-px w-full bg-primary border border-black-200 shadow-lg max-h-56 rounded-b-md py-1 ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" tabindex="-1" role="listbox">
 | 
			
		||||
      <ul v-show="showMenu" class="absolute z-10 -mt-px w-36 bg-primary border border-black-200 shadow-lg max-h-56 rounded-b-md py-1 ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" tabindex="-1" role="listbox">
 | 
			
		||||
        <template v-for="library in librariesFiltered">
 | 
			
		||||
          <li :key="library.id" class="text-gray-100 select-none relative py-2 cursor-pointer hover:bg-black-400" id="listbox-option-0" role="option" @click="selectLibrary(library)">
 | 
			
		||||
            <div class="flex items-center px-3">
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user