2013-10-05 08:16:04 -04:00
|
|
|
define(function(require) {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var angular = require('angular');
|
|
|
|
|
|
|
|
//
|
|
|
|
// Controller
|
|
|
|
//
|
|
|
|
|
2013-11-08 16:05:08 -05:00
|
|
|
var ReadCtrl = function($scope) {
|
|
|
|
$scope.state.read = {
|
|
|
|
open: false,
|
|
|
|
toggle: function(to) {
|
|
|
|
this.open = to;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
2013-10-05 08:16:04 -04:00
|
|
|
|
|
|
|
//
|
|
|
|
// Directives
|
|
|
|
//
|
|
|
|
|
|
|
|
var ngModule = angular.module('read', []);
|
|
|
|
ngModule.directive('frameLoad', function() {
|
|
|
|
return function(scope, elm) {
|
|
|
|
elm.bind('load', function() {
|
|
|
|
var frame = elm[0];
|
|
|
|
frame.height = frame.contentWindow.document.body.scrollHeight + 'px';
|
|
|
|
});
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
return ReadCtrl;
|
|
|
|
});
|