From 98ae9e67549c10f674396d56eff5c4fce85d65d5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 23 Apr 2016 10:25:33 +0530 Subject: [PATCH] Make the home icon in the breadcrumbs slightly larger Also remove unnecessary use of prototype --- src/pyj/book_list/search.pyj | 2 +- src/pyj/dom.pyj | 4 ++-- src/pyj/utils.pyj | 2 +- src/pyj/widgets.pyj | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pyj/book_list/search.pyj b/src/pyj/book_list/search.pyj index 3617d9369a..493539dc23 100644 --- a/src/pyj/book_list/search.pyj +++ b/src/pyj/book_list/search.pyj @@ -210,7 +210,7 @@ class SearchPanel: if item: li.appendChild(E.span(item.name)) else: - li.appendChild(svgicon('home')) + li.appendChild(svgicon('home', '2.2ex', '2.2ex')) create_breadcrumb() parent = self.tag_browser_data diff --git a/src/pyj/dom.pyj b/src/pyj/dom.pyj index b675d31aaf..6a4d06dd45 100644 --- a/src/pyj/dom.pyj +++ b/src/pyj/dom.pyj @@ -67,9 +67,9 @@ def create_keyframes(animation_name, *frames): ans.push('}') return ans.join('\n') + '\n' -def svgicon(name): +def svgicon(name, height, width): ans = document.createElementNS('http://www.w3.org/2000/svg', 'svg') - ans.setAttribute('style', 'fill: currentColor; height: 2ex; width: 2ex; vertical-align: text-top') + ans.setAttribute('style', 'fill: currentColor; height: {}; width: {}; vertical-align: text-top'.format(height ? '2ex', width ? '2ex')) u = document.createElementNS('http://www.w3.org/2000/svg', 'use') u.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', '#icon-' + name) ans.appendChild(u) diff --git a/src/pyj/utils.pyj b/src/pyj/utils.pyj index 9f54876af7..549d52a7b9 100644 --- a/src/pyj/utils.pyj +++ b/src/pyj/utils.pyj @@ -35,7 +35,7 @@ def parse_url_params(url=None, allow_multiple=False): key, val = pair.partition('=')[::2] key, val = decodeURIComponent(key), decodeURIComponent(val) if allow_multiple: - if not Object.prototype.hasOwnProperty.call(ans, key): + if ans[key] is undefined: ans[key] = [] ans[key].append(val) else: diff --git a/src/pyj/widgets.pyj b/src/pyj/widgets.pyj index 1f29e9434b..d0624444e4 100644 --- a/src/pyj/widgets.pyj +++ b/src/pyj/widgets.pyj @@ -95,5 +95,5 @@ def get_widget_css(): ans = 'a, button:focus { outline: none }; a, button::-moz-focus-inner { border: 0 }\n' ans += create_button.style ans += create_spinner.style - ans += Breadcrumbs.prototype.STYLE_RULES + ans += Breadcrumbs.STYLE_RULES return ans