Skip to content

Commit

Permalink
fix: show a tour example
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Sep 6, 2023
1 parent 039de31 commit a643867
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
19 changes: 7 additions & 12 deletions ckanext/tour/assets/js/tour-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ this.ckan.module('tour-init', function (jQuery) {
initialize: function () {
intro = introJs();
var introStart = true;
var visited = localStorage.getItem('intro');
// var visited = localStorage.getItem('intro');
var visited = false;
introStart = visited ? false : true;
var md = new MobileDetect(window.navigator.userAgent);
var isMobile = md.mobile() ? true : false;
Expand All @@ -32,22 +33,16 @@ this.ckan.module('tour-init', function (jQuery) {
showProgress: false, // default
steps: [
{
element: '.search-input-group',
element: '#dataset-search-form',
intro: this._('Here you can search datasets by a keyword.')
},
{
element: '.filters',
intro: this._('Here you can filter datasets.'),
position: 'right'
},
{
element: '.dataset-list',
intro: this._('The matched datasets will list here.'),
position: 'right'
element: ".filters",
intro: this._('Filter.')
},
{
element: '#intro-switch',
intro: this._('Click this question mark to show this help again.'),
element: '.account-masthead',
intro: this._('It is a toolbar.'),
position: 'right'
},
{
Expand Down
15 changes: 15 additions & 0 deletions ckanext/tour/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% ckan_extends %}

{% block scripts %}
{{ super() }}

<span class="hidden" data-module="tour-init"></span>

{% asset 'tour/tour-js' %}
{% endblock %}

{% block styles %}
{{ super() }}

{% asset 'tour/tour-css' %}
{% endblock %}

0 comments on commit a643867

Please sign in to comment.