Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #5192 use menudropdown widget for language selector as well to s…
…implify code and have same look&feel
- Loading branch information
Showing
12 changed files
with
88 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,7 +218,6 @@ a.Piwik_Popover_Error_Back { | |
} | ||
|
||
#userMenu .items { | ||
margin-left: -105px; | ||
width: 150px; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
plugins/LanguagesManager/angularjs/languageselector/languageselector-directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/*! | ||
* Piwik - Web Analytics | ||
* | ||
* @link http://piwik.org | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
*/ | ||
|
||
/** | ||
* Usage: | ||
* <div class="languageSelection"> | ||
* </div> | ||
*/ | ||
angular.module('piwikApp').directive('languageSelection', function() { | ||
|
||
return { | ||
restrict: 'C', | ||
link: function(scope, element, attr, ctrl) { | ||
|
||
function postLanguageChange () { | ||
var value = $(this).attr('value'); | ||
if (value) { | ||
element.find('#language').val(value).parents('form').submit(); | ||
} | ||
} | ||
|
||
element.on('click', 'a[value]', postLanguageChange); | ||
scope.$on('$destroy', function() { | ||
element.off('click', 'a[value]', postLanguageChange); | ||
}); | ||
} | ||
}; | ||
}); |
This file was deleted.
Oops, something went wrong.
26 changes: 14 additions & 12 deletions
26
plugins/LanguagesManager/templates/getLanguagesSelector.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
<span class="topBarElem"> | ||
<span id="languageSelection"> | ||
<form action="index.php?module=LanguagesManager&action=saveLanguage" method="post"> | ||
<select name="language" id="language"> | ||
<option title="" value="" | ||
href="?module=Proxy&action=redirect&url=http://piwik.org/translations/">{{ 'LanguagesManager_AboutPiwikTranslations'|translate }}</option> | ||
{% for language in languages %} | ||
<option value="{{ language.code }}" {% if language.code == currentLanguageCode %}selected="selected"{% endif %} | ||
title="{{ language.name }} ({{ language.english_name }})">{{ language.name }}</option> | ||
{% endfor %} | ||
</select> | ||
<div class="languageSelection" | ||
menu-title="{{ currentLanguageName|e('html_attr') }}" | ||
piwik-menudropdown> | ||
<a class="item" | ||
href="?module=Proxy&action=redirect&url=http://piwik.org/translations/">{{ 'LanguagesManager_AboutPiwikTranslations'|translate }}</a> | ||
{% for language in languages %} | ||
<a class="item {% if language.code == currentLanguageCode %}active{% endif %}" | ||
value="{{ language.code }}" | ||
title="{{ language.name }} ({{ language.english_name }})">{{ language.name }}</a> | ||
{% endfor %} | ||
|
||
<form action="index.php?module=LanguagesManager&action=saveLanguage" method="post"> | ||
<input type="hidden" name="language" id="language"> | ||
{# During installation token_auth is not set #} | ||
{% if token_auth is defined %}<input type="hidden" name="token_auth" value="{{ token_auth }}"/>{% endif %} | ||
<input type="submit" value="go"/> | ||
</form> | ||
</span> | ||
</div> | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,3 @@ | ||
#languageSelect { | ||
max-height: 400px; | ||
overflow-y: auto; | ||
overflow-x: hidden; | ||
padding: 0 !important; | ||
background:#FFF; | ||
border: 1px solid #1F447F!important; | ||
} | ||
|
||
#languageSelection { | ||
.languageSelection { | ||
padding-right: 11px; | ||
} | ||
|
||
#languageSelection > form { | ||
display: inline-block; | ||
} | ||
|
||
#languageSelection input, #languageSelection select { | ||
display: none; | ||
} | ||
|
||
#languageSelection .ui-autocomplete-input:after { | ||
display: inline; | ||
content: " \25BC"; | ||
font-size: 0.9em; | ||
} | ||
#languageSelection .ui-autocomplete-input { | ||
text-decoration: underline; | ||
} | ||
|
||
#languageSelect .ui-autocomplete-input:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
#languageSelect a { | ||
text-decoration:none!important; | ||
padding: 1px 25px 1px 3px!important; | ||
} | ||
|
||
#languageSelect a:hover { | ||
background:#176999!important; | ||
color:#FFF!important; | ||
} |