Skip to content

Commit

Permalink
feat(test): Added coverage for 'justifyFull' button.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelParke committed Jul 29, 2015
1 parent 0eb2f38 commit 72cca33
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 73 deletions.
2 changes: 1 addition & 1 deletion dist/textAngular.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ if(_browserDetect.ie > 8 || _browserDetect.ie === undefined){
/* istanbul ignore next: tests are browser specific */
_removeCSSRule = function(sheet, rule){
var rules = sheet.cssRules || sheet.rules;
if(!rules) return;
if(!rules || rules.length === 0) return;
var ruleIndex = _getRuleIndex(rule, rules);
if(sheet.removeRule){
sheet.removeRule(ruleIndex);
Expand Down
4 changes: 2 additions & 2 deletions dist/textAngular.min.js

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion dist/textAngularSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ angular.module('textAngularSetup', [])
toolbar: [
['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'pre', 'quote'],
['bold', 'italics', 'underline', 'strikeThrough', 'ul', 'ol', 'redo', 'undo', 'clear'],
['justifyLeft','justifyCenter','justifyRight','indent','outdent'],
['justifyLeft','justifyCenter','justifyRight','justifyFull','indent','outdent'],
['html', 'insertImage', 'insertLink', 'insertVideo', 'wordcount', 'charcount']
],
classes: {
Expand Down Expand Up @@ -165,6 +165,9 @@ angular.module('textAngularSetup', [])
justifyRight: {
tooltip: 'Align text right'
},
justifyFull: {
tooltip: 'Justify text'
},
justifyCenter: {
tooltip: 'Center'
},
Expand Down Expand Up @@ -509,6 +512,19 @@ angular.module('textAngularSetup', [])
return result;
}
});
taRegisterTool('justifyFull', {
iconclass: 'fa fa-align-justify',
tooltiptext: taTranslations.justifyFull.tooltip,
action: function(){
return this.$editor().wrapSelection("justifyFull", null);
},
activeState: function(commonElement){
var result = false;
if(commonElement) result = commonElement.css('text-align') === 'justify';
result = result || this.$editor().queryCommandState('justifyFull');
return result;
}
});
taRegisterTool('justifyCenter', {
iconclass: 'fa fa-align-center',
tooltiptext: taTranslations.justifyCenter.tooltip,
Expand Down
Loading

0 comments on commit 72cca33

Please sign in to comment.