Skip to content

Commit

Permalink
Chore(release): Bump and build dist
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSharpieOne committed Feb 27, 2015
1 parent 566ae5b commit 4447b7d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-sails",
"version": "1.1.0",
"version": "1.1.1",
"authors": [
"Jan-Oliver Pantel <info@janpantel.de>"
],
Expand Down
19 changes: 16 additions & 3 deletions dist/angular-sails.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ angular.module('ngSails', ['ng']);
/*global angular, io */
(function(angular, io) {
'use strict';
io.sails.autoConnect = false;
if(io.sails){
io.sails.autoConnect = false;
}

// copied from angular
function parseHeaders(headers) {
Expand Down Expand Up @@ -53,7 +55,7 @@ angular.module('ngSails', ['ng']);

this.httpVerbs = ['get', 'post', 'put', 'delete'];

this.eventNames = ['on', 'off', 'once'];
this.eventNames = ['on', 'off'];

this.url = undefined;

Expand Down Expand Up @@ -211,7 +213,7 @@ angular.module('ngSails', ['ng']);
}

function wrapEvent(eventName) {
if(socket[eventName] || socket._raw[eventName]){
if(socket[eventName] || socket._raw && socket._raw[eventName]){
socket['legacy_' + eventName] = socket[eventName] || socket._raw[eventName];
socket[eventName] = function(event, cb) {
if (cb !== null && angular.isFunction(cb)) {
Expand All @@ -223,6 +225,17 @@ angular.module('ngSails', ['ng']);
}
}

// sails.io.js doesn't have `once`, need to access it through `._raw`
socket.once = function(event, cb){
if (cb !== null && angular.isFunction(cb)) {
if(socket._raw){
socket._raw.once(event, function(result) {
$rootScope.$evalAsync(cb.bind(socket, result));
});
}
}
};

angular.forEach(provider.httpVerbs, promisify);
angular.forEach(provider.eventNames, wrapEvent);

Expand Down
2 changes: 1 addition & 1 deletion dist/angular-sails.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-sails",
"private": true,
"version": "1.1.0",
"version": "1.1.1",
"description": "An angular provider for using the sails socket.io api",
"scripts": {
"build": "gulp build-js",
Expand Down

0 comments on commit 4447b7d

Please sign in to comment.