Expose utils to the scope and use isMobileUi in input.html

This commit is contained in:
Alice Jenkinson 2017-03-18 03:29:59 +13:00
parent c6a8b69fe0
commit 64e801ef65
2 changed files with 4 additions and 5 deletions

View File

@ -3,7 +3,7 @@
<textarea id="{{inputId}}" class="form-control favorite-font" ng-trim="false" rows="1" ng-change="inputChanged()" autocomplete="on" ng-model="command" ng-focus="hideSidebar()"> <textarea id="{{inputId}}" class="form-control favorite-font" ng-trim="false" rows="1" ng-change="inputChanged()" autocomplete="on" ng-model="command" ng-focus="hideSidebar()">
</textarea> </textarea>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-complete-nick unselectable" title="Complete nick" ng-hide="hideCompleteNickButton()" ng-click="handleCompleteNickButton($event)"><i class="glyphicon glyphicon-chevron-right"></i></button> <button class="btn btn-complete-nick unselectable" title="Complete nick" ng-hide="!utils.isMobileUi()" ng-click="handleCompleteNickButton($event)"><i class="glyphicon glyphicon-chevron-right"></i></button>
<label class="btn btn-send-image unselectable" for="imgur-upload" title="Send image"> <label class="btn btn-send-image unselectable" for="imgur-upload" title="Send image">
<i class="glyphicon glyphicon-picture"></i> <i class="glyphicon glyphicon-picture"></i>
<input type="file" accept="image/*" multiple title="Send image" id="imgur-upload" class="imgur-upload" file-change="uploadImage($event, files)"> <input type="file" accept="image/*" multiple title="Send image" id="imgur-upload" class="imgur-upload" file-change="uploadImage($event, files)">

View File

@ -25,6 +25,9 @@ weechat.directive('inputBar', function() {
settings, settings,
utils) { utils) {
// Expose utils to be able to check if we're on a mobile UI
$scope.utils = utils;
// E.g. Turn :smile: into the unicode equivalent // E.g. Turn :smile: into the unicode equivalent
$scope.inputChanged = function() { $scope.inputChanged = function() {
$scope.command = emojione.shortnameToUnicode($scope.command); $scope.command = emojione.shortnameToUnicode($scope.command);
@ -504,10 +507,6 @@ weechat.directive('inputBar', function() {
$scope.completeNick(); $scope.completeNick();
return true; return true;
}; };
$scope.hideCompleteNickButton = function() {
return !utils.isMobileUi();
};
}] }]
}; };
}); });