Commit db43813a authored by Regis's avatar Regis

add CONST and one line a tag in pagination - add request to false in store handler

parent 211ee4b9
......@@ -5,6 +5,7 @@
((gl) => {
const PAGINATION_UI_BUTTON_LIMIT = 4;
const UI_LIMIT = 6;
const SPREAD = '...';
const PREV = 'Prev';
const NEXT = 'Next';
......@@ -104,7 +105,7 @@
items.push({ title: PREV, disabled: true });
}
if (page > 6) items.push({ title: SPREAD, separator: true });
if (page > UI_LIMIT) items.push({ title: SPREAD, separator: true });
const start = Math.max(page - PAGINATION_UI_BUTTON_LIMIT, 1);
const end = Math.min(page + PAGINATION_UI_BUTTON_LIMIT, total);
......@@ -139,11 +140,7 @@
disabled: item.disabled
}'
>
<a
@click="changePage($event)"
>
{{item.title}}
</a>
<a @click="changePage($event)">{{item.title}}</a>
</li>
</ul>
</div>
......
......@@ -36,14 +36,12 @@
'vue-pipelines': gl.VuePipelines,
},
template: `
<div>
<vue-pipelines
:scope='scope'
:store='store'
:svgs='svgs'
>
</vue-pipelines>
</div>
<vue-pipelines
:scope='scope'
:store='store'
:svgs='svgs'
>
</vue-pipelines>
`,
});
}
......
......@@ -34,9 +34,10 @@
updatePipelineNums(this.count);
this.pageRequest = false;
}, () => new Flash(
'Something went wrong on our end.',
));
}, () => {
this.pageRequest = false;
return new Flash('Something went wrong on our end.');
});
goFetch();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment