Skip to content

Commit

Permalink
Merge branch 'ui-dev' of github.com:Laki7877/reachrabbit-client into …
Browse files Browse the repository at this point in the history
…ui-dev
  • Loading branch information
poonwu committed Oct 19, 2016
2 parents 6ebc37d + dc42d80 commit 5bf38dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,10 @@ angular.module('reachRabbitApp.brand.controller', ['reachRabbitApp.service'])
$scope.alert.danger(o.message);
return;
}

if (profile.brand.website && profile.brand.website.length > 1 && !profile.brand.website.startsWith("http")) {
profile.brand.website = "http://" + profile.brand.website;
}

AccountService.saveProfile(profile)
.then(function (response) {
Expand All @@ -1543,9 +1547,11 @@ angular.module('reachRabbitApp.brand.controller', ['reachRabbitApp.service'])
if($scope.formData.brand.isCompany) {
$scope.alreadyCompany = true;
}

//set back to localstorage
UserProfile.set(response.data);


$scope.form.$setPristine();
$scope.success = true;
$scope.alert.success('บันทึกข้อมูลเรียบร้อย!');
Expand Down
2 changes: 1 addition & 1 deletion app/view/brand-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h1>Profile ของฉัน</h1>
เว็บไซต์ของ Brand
</div>
<div class="card-body-content">
<input type="text" ng-model="formData.brand.website" class="form-control" maxlength="200" url-mask placeholder="www.mybrand.com or www.facebook.com/mybrand"/>
<input type="text" ng-model="formData.brand.website" class="form-control" maxlength="200" placeholder="www.mybrand.com or www.facebook.com/mybrand"/>
</div>
</div>
<div class="card-row">
Expand Down

0 comments on commit 5bf38dd

Please sign in to comment.