Make the home icon in the breadcrumbs slightly larger

Also remove unnecessary use of prototype
This commit is contained in:
Kovid Goyal 2016-04-23 10:25:33 +05:30
parent 7a50cbf7cf
commit 98ae9e6754
4 changed files with 5 additions and 5 deletions

View File

@ -210,7 +210,7 @@ class SearchPanel:
if item: if item:
li.appendChild(E.span(item.name)) li.appendChild(E.span(item.name))
else: else:
li.appendChild(svgicon('home')) li.appendChild(svgicon('home', '2.2ex', '2.2ex'))
create_breadcrumb() create_breadcrumb()
parent = self.tag_browser_data parent = self.tag_browser_data

View File

@ -67,9 +67,9 @@ def create_keyframes(animation_name, *frames):
ans.push('}') ans.push('}')
return ans.join('\n') + '\n' return ans.join('\n') + '\n'
def svgicon(name): def svgicon(name, height, width):
ans = document.createElementNS('http://www.w3.org/2000/svg', 'svg') 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 = document.createElementNS('http://www.w3.org/2000/svg', 'use')
u.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', '#icon-' + name) u.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', '#icon-' + name)
ans.appendChild(u) ans.appendChild(u)

View File

@ -35,7 +35,7 @@ def parse_url_params(url=None, allow_multiple=False):
key, val = pair.partition('=')[::2] key, val = pair.partition('=')[::2]
key, val = decodeURIComponent(key), decodeURIComponent(val) key, val = decodeURIComponent(key), decodeURIComponent(val)
if allow_multiple: if allow_multiple:
if not Object.prototype.hasOwnProperty.call(ans, key): if ans[key] is undefined:
ans[key] = [] ans[key] = []
ans[key].append(val) ans[key].append(val)
else: else:

View File

@ -95,5 +95,5 @@ def get_widget_css():
ans = 'a, button:focus { outline: none }; a, button::-moz-focus-inner { border: 0 }\n' ans = 'a, button:focus { outline: none }; a, button::-moz-focus-inner { border: 0 }\n'
ans += create_button.style ans += create_button.style
ans += create_spinner.style ans += create_spinner.style
ans += Breadcrumbs.prototype.STYLE_RULES ans += Breadcrumbs.STYLE_RULES
return ans return ans