Skip to content

Commit 48efbce

Browse files
Shkarinphp-coder
authored andcommitted
/series/add: country suggestion link now works in the prototype.
Fix #572
1 parent 07599cf commit 48efbce

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/main/java/ru/mystamps/web/Url.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public final class Url {
8080
public static final String ADD_SERIES_WITH_COUNTRY_PAGE = "/series/add/country/{slug}";
8181

8282
// MUST be updated when any of our resources were modified
83-
public static final String RESOURCES_VERSION = "v0.3.1";
83+
public static final String RESOURCES_VERSION = "v0.3.2";
8484

8585
// CheckStyle: ignore LineLength for next 4 lines
8686
public static final String MAIN_CSS = "/static/" + RESOURCES_VERSION + "/styles/main.min.css";

src/main/javascript/series/add.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ function initPage(suggestCountryUrl) {
3030

3131
var country = $("#js-guess-country-link");
3232
country.click(function chooseSuggestedCountry() {
33-
$(this).hide();
34-
35-
var select_country = $("#country").selectize();
36-
var selectize = select_country[0].selectize;
37-
selectize.setValue(slug);
33+
chooseCountryBySlug(slug);
34+
country.hide();
3835
});
3936
country.show();
4037
});
4138
}
4239
}
40+
41+
function chooseCountryBySlug(slug) {
42+
var select_country = $("#country").selectize();
43+
var selectize = select_country[0].selectize;
44+
selectize.setValue(slug);
45+
}

src/main/webapp/WEB-INF/static/styles/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,7 @@ label {
107107
.goog-tooltip {
108108
color: white;
109109
}
110+
111+
.link-vcenter {
112+
line-height: 34px;
113+
}

src/main/webapp/WEB-INF/views/series/add.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ <h3 th:text="${#strings.capitalize(add_series)}">
204204
</div>
205205

206206
<small togglz:active="SHOW_SUGGESTION_LINK">
207-
<a tabindex="-1" th:text="#{t_guess_country}" href="javascript:void(0)" id="js-guess-country-link" th:style="'display: none; position: relative; top: 7px;'">Guess a country</a>
207+
<a tabindex="-1" th:text="#{t_guess_country}" href="javascript:$('#js-guess-country-link').hide(); chooseCountryBySlug('russia'); void(0)" th:href="'javascript:void(0)'" id="js-guess-country-link" class="link-vcenter" th:style="'display: none'">Guess a country</a>
208208
</small>
209209
</div>
210210

0 commit comments

Comments
 (0)