Skip to content

Instantly share code, notes, and snippets.

View JediMindtrick's full-sized avatar

Brandon Wilhite JediMindtrick

View GitHub Profile
@JediMindtrick
JediMindtrick / AngularTheBasics-SafeApply
Last active August 29, 2015 14:09
Function for safely applying a AngularJS $scope.$apply regardless of $digest phase
function runScope(angularScope,callback){
var result = void 0;
var phase = angularScope.$root.$$phase;
if(phase == '$apply' || phase == '$digest'){
result = callback === undefined ? void 0 : callback(angularScope);
}else{
angularScope.$apply(function(){
result = callback === undefined ? void 0 : callback(angularScope);
@JediMindtrick
JediMindtrick / gist:9506761
Created March 12, 2014 13:18
Working html for jQuery tooltip on table header + IE8
<!--Instead of this,-->
<tr>
<th title="my tooltip content">Hover for tooltip</th>
</tr>
<!-- you might try this-->
<tr>
<th>
<div title="mytooltip content">Hover for tooltip</div>
</th>
</tr>