Fixed error

This commit is contained in:
Borys Levytskyi
2015-04-04 19:42:44 +03:00
parent a22a6deae0
commit ffe5e6d33d

View File

@@ -5,6 +5,7 @@ app.compose(function () {
var formatter = app.get('formatter');
var calc = app.get('calc');
var html = app.get('html');
var cmdConfig = app.get('cmdConfig');
app.modelView(app.models.BitwiseOperation, {
renderView: function(expr) {
@@ -28,12 +29,6 @@ app.compose(function () {
var maxLen = getBinaryLength(model.numbers);
var table = html.element('<table class="expression"></table>');
if(app.emphasizeBytes) {
if(maxLen % 8 != 0) {
maxLen += Math.floor(maxLen / 8) + 8;
}
}
model.numbers.forEach(function(o){
var row = table.insertRow();
@@ -77,7 +72,7 @@ app.compose(function () {
function getBinaryLength(arr) {
var bits = calc.maxNumberOfBits(arr);
if(app.emphasizeBytes && bits % 8 != 0) {
if(cmdConfig.emphasizeBytes && bits % 8 != 0) {
if(bits < 8) {
return 8;
}