Commit 6ffe785644e8b69e1a8c8f40e03d5545c7ae9735

Authored by OpenWapp Developer

Merge branch 'issue46' of /home/git/repositories/openwapp/openwapp

Showing 1 changed file

app/scripts/views/group-profile.js View file @ 6ffe785
... ... @@ -85,7 +85,12 @@
85 85 if (evt) { evt.preventDefault(); }
86 86 var subject = $('input[name=subject]').val();
87 87 var button = $('button.done');
88   - button.prop('disabled', subject.length < 3 || subject.length > 25);
  88 + var maxSubjectLength = global.client.getProperty('max_subject');
  89 + button.prop('disabled', subject.length < 3 ||
  90 + subject.length > maxSubjectLength);
  91 + if (subject.length >= maxSubjectLength) {
  92 + $('input[name=subject]').val(subject.slice(0, 24));
  93 + }
89 94 },
90 95  
91 96 _createGroup: function (evt) {