Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Bloco de código
themeEclipse
languagejs
titleminhawidget.js
var UserPreferences = SuperWidget.extend({

	alias: null,
    type: null,
	
	bindings: {
		local: {
			'update-image': ['click_updateImage']
		}
	},
	
	init: function() {
		this.type = 'gif|jpg|jpeg|png';
	},
	
	selectCommunity: function(el, ev) {
		var self = this,
		typeCommunity = $('.type-community', self.DOM);
		SOCIALBC.selectCommunity({
			multiselect : false,
			required : true
		}, function(data) {
			var community = data[0],
				params = {
					value: community.communityId,
					text: community.communityAlias,
					tab: self.tabSelected,
					type: 'community',
					name: 'community',
					tabuser: self.tabSelected + self.userId
				};
			typeCommunity.parent().remove();
			self.removeFilter('community');
			self.saveItem(params);
			self.insertTagFilter(params);
			$('#community-filter').val(community.communityAlias);
		});
	},

	/*updateImage: function(el, ev) {
		var that = this;
		WCMBC.cropImage({
			alias: this.alias,
			types: this.type
		}, function(err, data) {
			if(err) {
				return alert(err.responseText);
			}
			
			that.someFunc(data);
		});
	},*/
	
	someFunc: function(data) {
		//Qualquer coisa com o retorno de sucesso...
	}
});

...