Skip to content

Insert tool, ingredient, and instruction in between existing ones #575

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

Merged
merged 3 commits into from
Feb 11, 2021
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
[#562](https://github.com./nextcloud/cookbook/pull/562/) @seyfeb
- Bundle Analyzer documentation
[#573](https://github.com./nextcloud/cookbook/pull/573/) @seyfeb
- Added button to allow adding empty ingredient, instruction, and tool entries above existing ones in editor
[#575](https://github.com./nextcloud/cookbook/pull/575/) @seyfeb

### Changed
- Using computed property in recipe view
Expand Down
9 changes: 5 additions & 4 deletions src/components/EditInputGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
<input v-if="fieldType==='text'" type="text" ref="list-field" v-model="buffer[idx]" @keyup="keyPressed" v-on:input="handleInput" @paste="handlePaste" />
<textarea v-else-if="fieldType==='textarea'" ref="list-field" v-model="buffer[idx]" @keyup="keyPressed" v-on:input="handleInput" @paste="handlePaste"></textarea>
<div class="controls">
<button class="icon-arrow-up" @click="moveEntryUp(idx)"></button>
<button class="icon-arrow-down" @click="moveEntryDown(idx)"></button>
<button class="icon-delete" @click="deleteEntry(idx)"></button>
<button class="icon-arrow-up" @click="moveEntryUp(idx)" :title="t('cookbook', 'Move entry up')"></button>
<button class="icon-arrow-down" @click="moveEntryDown(idx)" :title="t('cookbook', 'Move entry down')"></button>
<button class="icon-add" @click="addNewEntry(idx)" :title="t('cookbook', 'Insert entry above')"></button>
<button class="icon-delete" @click="deleteEntry(idx)" :title="t('cookbook', 'Delete entry')"></button>
</div>
</li>
</ul>
<button class="button add-list-item" @click="addNewEntry ()"><span class="icon-add"></span> {{ t('cookbook', 'Add') }}</button>
<button class="button add-list-item" @click="addNewEntry()"><span class="icon-add"></span> {{ t('cookbook', 'Add') }}</button>
</fieldset>
</template>

Expand Down
22 changes: 18 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ module.exports = {
rules: [
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader'],
use: [{ loader: 'vue-style-loader' },
{
loader: 'css-loader',
options: {
esModule: false
}
},
// [sass-loader](/loaders/sass-loader)
{ loader: 'sass-loader' }
]
},
{
test: /\.html$/,
Expand Down Expand Up @@ -61,9 +70,14 @@ module.exports = {
{
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
'sass-loader'
{ loader: 'vue-style-loader' },
{
loader: 'css-loader',
options: {
esModule: false
}
},
{ loader: 'sass-loader' }
]
}
],
Expand Down