mail/src/js/controller/read.js

38 lines
821 B
JavaScript
Raw Normal View History

define(function(require) {
'use strict';
var angular = require('angular');
//
// Controller
//
var ReadCtrl = function($scope) {
$scope.state.read = {
open: false,
toggle: function(to) {
this.open = to;
}
};
$scope.lineEmpty = function(line) {
return line.replace(/>/g, '').trim().length === 0;
};
};
//
// 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;
});