if you use angularjs you can try this.
.html
<button ng-click="enlarge(x.ID)" class="{{fullglyphon[x.ID]}}" ng-init="fullglyphon[x.ID] = 'btn btn-xs btn-primary glyphicon glyphicon-resize-full'"></button>
.js
$scope.enlarge = function(myID) { $scope.fullglyphon[myID] = "btn btn-xs btn-primary glyphicon glyphicon-resize-small";}
toggle last one or do if comparison
if ( $scope.fullglyphon[myID] == "btn btn-xs btn-primary glyphicon glyphicon-resize-small" ) { $scope.fullglyphon[myID] = "btn btn-xs btn-primary glyphicon glyphicon-resize-full"; }else{ $scope.fullglyphon[myID] = "btn btn-xs btn-primary glyphicon glyphicon-resize-small"; }