"use strict";
define(['./Element'],function(element){
	return element.extend({
		getConfig:function(obj,column,recordActions){
			var self = this;
			var field = openbiz.Element.getConfig.call(this,obj,column);
			{
				if(recordActions.length > 0){
					field.cell = openbiz.Grid.UriCell.extend({
						render:function(){
							this.$el.empty();
							var model = this.model;
							var value = model.get("_id");
							var html = "<div class='tooltip-area'>";
							for (var i in recordActions){
								var recordAction = recordActions[i];
								if(self._hasPermission(recordAction.permission))
								{
<<<<<<< HEAD
									switch(recordAction.type.toLowerCase()){
										case "link":
										{
											html = html + "<a href='"+recordAction.url+"' class='btn btn-default'>"+recordAction["displayName"]+"</a>"+"&nbsp";
											break;
										}
										case "button":
										{
											var className = "rec-act-"+recordAction["name"].toLowerCase();
											html = html + "<a href='#' record-id='{{ id }}' class='btn btn-default "+ className+"'>"+recordAction["displayName"]+"</a>"+"&nbsp";
											break;
										}
										default:
										{
											break;
										}
									}
=======
									var className = "rec-act-"+recordAction["name"].toLowerCase();
									html = html + "<a href='#' record-id='{{ id }}' record-name='{{ id }}'  class='btn btn-default "+ className+"'>"+recordAction["displayName"]+"</a>"+"&nbsp";
>>>>>>> d537a82d7934f0739460248c9edf7db5bf572e2c
								}
							}
							html = html + "</div>";
							this.$el.html( _.template(
								html,
								{id:value},
								{interpolate: /\{\{(.+?)\}\}/g}) );
							this.delegateEvents();
							return this;
						}
					});
				}
			}
			return field;
		},
		_hasPermission:function(permission){
			if(typeof permission != 'undefined' && permission){
				return openbiz.session.me.hasPermission(permission);
			}
			return true;
		}
	});
});
@@ -610,21 +610,8 @@
 %09%09%7B%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A
 %09%09%09%09
@@ -1209,303 +1209,8 @@
 %09%09%7D%0A
-=======%0A%09%09%09%09%09%09%09%09%09var className = %22rec-act-%22+recordAction%5B%22name%22%5D.toLowerCase();%0A%09%09%09%09%09%09%09%09%09html = html + %22%3Ca href='#' record-id='%7B%7B id %7D%7D' record-name='%7B%7B id %7D%7D'  class='btn btn-default %22+ className+%22'%3E%22+recordAction%5B%22displayName%22%5D+%22%3C/a%3E%22+%22&nbsp%22;%0A%3E%3E%3E%3E%3E%3E%3E d537a82d7934f0739460248c9edf7db5bf572e2c%0A
 %09%09%09%09

update recordactions